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.
source
share