From: Warren Block Date: 2007-09-29T00:35:13+09:00 Subject: Re: How to use getname() ? kazaam wrote: > I seem to stupid but how can I use getname?!? My aim is getting the > domain or subdomain behind an IP-address. I required socket and tried > then: > > hostname = getname(IP) > > but this doesn't work. I also can't get wiser by reading the doc about > it: > http://www.ruby-doc.org/stdlib/libdoc/resolv/rdoc/classes/Resolv.html > . > > Someone knows how to use getname() ? Looking at resolv.rb will show you an example. I don't know why that's not on the Resolv page. require 'resolv' hostname = Resolv.getname('127.0.0.1') -- Warren Block * Rapid City, South Dakota * USA