Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Ruby, how do you reverse dns lookup the hostname of a zeroconf/bonjour computer?

Tags:

ruby

mdns

Neither

Resolv.getname( "fred.local" ) 
Resolv.getaddress( "10.0.1.18" )

nor

Socket.gethostbyaddr([10,0,1,18].pack("CCCC")) 

seem to recognize hosts on the local subnet which use zeroconf/bonjour. I need to find the hostname of a zeroconf computer on the local subnet given its ip address.

like image 588
Uilleann Avatar asked Nov 12 '22 07:11

Uilleann


1 Answers

Those function speak regular TCP and DNS, I would assume you need to use a bonjour API, such as http://dnssd.rubyforge.org/

like image 198
DGM Avatar answered Nov 15 '22 04:11

DGM