In Ruby, how do you change dns, look at the hostname of a zeroconf / bonjour computer?

Neither

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

and

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

It seems that hosts on the local subnet that use zeroconf / bonjour are recognized. I need to find the host name of the zeroconf computer in the local subnet with its IP address.

+5
source share
2 answers

These functions speak of regular TCP and DNS, I would suggest that you need to use the bonjour API, for example http://dnssd.rubyforge.org/

+1
source

It seems that the link from the DGM post has stopped working and I have no comments for comments :)

https://github.com/tenderlove/dnssd

0
source

All Articles