# DNS-SD Gem (0.6.0) on OSX Leopard 10.5.3

**URL:** <https://www.ruby-forum.com/t/dns-sd-gem-0-6-0-on-osx-leopard-10-5-3/140783>\
**Category:** Ruby\
**Created:** [June 18, 2008, 2:46pm UTC](https://www.ruby-forum.com/t/dns-sd-gem-0-6-0-on-osx-leopard-10-5-3/140783 "2008-06-18T14:46:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Don\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@Don\_L](https://www.ruby-forum.com/u/Don_L)\
**Post date:** [June 18, 2008, 2:46pm UTC](https://www.ruby-forum.com/t/dns-sd-gem-0-6-0-on-osx-leopard-10-5-3/140783/1 "2008-06-18T14:46:33Z")

</div>

Hi All,

I am attempting to use the DNS-SD gem to return information about  
bonjour on Leopard. When I use the command line tool with the command  
“$ dns-sd -B \_sftp-ssh.\_tcp” I get the following response:

Browsing for \_sftp-ssh.\_tcp  
Timestamp A/R Flags if Domain Service  
Type Instance Name  
8:34:04.871 Add 3 5 local. \_sftp-  
ssh.\_tcp. DL Office Desktop  
8:34:04.872 Add 3 9 local. \_sftp-  
ssh.\_tcp. DL Office Desktop  
8:34:04.872 Add 3 10 local. \_sftp-  
ssh.\_tcp. DL Office Desktop  
8:34:04.872 Add 3 7 local. \_sftp-  
ssh.\_tcp. DL Office Desktop  
8:34:04.872 Add 2 8 local. \_sftp-  
ssh.\_tcp. DL Office Desktop

However, when I run the following I get no response back:

#!/usr/bin/env ruby -wKU

require ‘rubygems’  
require ‘dnssd’

DNSSD.browse("\_sftp-ss.\_tcp") do |browse\_reply|  
puts browse\_reply  
end

I am using ruby 1.8.6 on Leopard 10.5.3 with dnssd-0.6.0 (ruby and the  
gem were part of the standard Leopard install). My ultimate goal will  
be to browse for DNSSD services and then resolve a particular service.

Thank you in advance for any help you might be able to render.

Don L., Psy. D.  
President, Vanguard Custom Software  
“We create simple applications which solve complex problems”

removed\_email\_address@domain.invalid  
(917) 842-2911

---

<div class="post-metadata">

**Author:** ![Don\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@Don\_L](https://www.ruby-forum.com/u/Don_L)\
**Post date:** [June 18, 2008, 5:24pm UTC](https://www.ruby-forum.com/t/dns-sd-gem-0-6-0-on-osx-leopard-10-5-3/140783/2 "2008-06-18T17:24:09Z")

</div>

Hi All,

I was in error in my last email. In fact, DNSSD.browse is returning  
the result as expect. instead, DNSSD.resolve is not returning any  
response when the [dns-sd -L “Denis’s MacBook Air” \_ssh.\_tcp local]  
command line tool returns the response as expected.

Here is the commandline response:

* * *

Don-Levan-x-392:~ donl$ dns-sd -L “Denis’s MacBook Air” \_ssh.\_tcp local  
Lookup Denis’s MacBook Air.\_ssh.\_tcp.local  
11:04:13.345 Denis’s\032MacBook\032Air.\_ssh.\_tcp.local. can be  
reached at Deniss-MacBook-Air.local.:22

Here is what my script looks like:

* * *

#!/usr/bin/env ruby -wKU

require ‘rubygems’  
require ‘dnssd’

class DNSResolver

def resolve  
puts “resolving”

```
 resolver = DNSSD.resolve("Denis's MacBook Air", "_ssh._tcp",

```

“local”) do |resolve\_reply|  
puts “Resolve Result: #{resolve\_reply.inspect}”  
end

```
 puts "Resolver Started"
 sleep 30
 resolver.stop
 puts "Resolver Stopped"

```

end

end

resolve\_reply = DNSResolver.new.resolve

* * *

This is the response from I get in textmate:

* * *

RubyMate r8136 running Ruby r1.8.6 (/System/Library/Frameworks/  
Ruby.framework/Versions/1.8/usr/bin/ruby) \>\>\> dnssdbrowse.rb  
resolving  
Resolver Started  
Resolver Stopped  
Program exited.

Thanks again for any help.

Don L.
