From: Vladimir Fekete Date: 2008-11-20T19:03:03+09:00 Subject: Re: Question about host, gethostbyname and getaddress Hi, On Thu, Nov 20, 2008 at 06:56:08PM +0900, Pe?a, Botp wrote: > From: Vladimir Fekete [mailto:fekete@melkor.dnp.fmph.uniba.sk] > # ... why I believe this is true is, that "host" command works > # perfectly withouth correct reverse dns.... > > > try resolv. > > eg, > > > require 'resolv' > => true > > > Resolv.getname "10.2.10.123" > => "bg-mis-pbot.delmonte-phil.com" > > i believe that is my pc ;) > > > Resolv.getname "10.2.10.23" > => "bgmissappm00.delmonte-phil.com" this does not work either. Code: #!/usr/bin/env ruby require 'resolv' puts Resolv.getname("10.0.2.1").to_s result: /usr/lib/ruby/1.8/resolv.rb:128:in `getname': no name for 10.0.2.1 /(Resolv::ResolvError) from /usr/lib/ruby/1.8/resolv.rb:64:in `getname' from ./test.rb:6 so as I said before, I don't have reverse dns (e.g. to get in-addr.arpa from dns) and host command works, rubys' commands dont. :-( I guess I will have to use `host` insted of pure ruby code. regards, V. > > not mine ;) > >