From: Reimer Behrends Date: 2003-09-30T05:30:19+09:00 Subject: Re: TCPSocket.gethostbyname difficulties Yukihiro Matsumoto (matz@ruby-lang.org) wrote: [...] > This works for me: > > ruby -r socket -e 'p TCPSocket.gethostbyname("noblepack.com")' > ruby 1.8.0 (2003-09-27) [i686-linux] > ["noblepack.com", [], 2, "205.178.141.161"] > > Could you tell us more info? This surprises me, since there is no PTR record for 205.178.141.161, and ruby (1.8.0 in my case) insists on doing a gethostbyaddr() on that address (in sock_hostbyname()) and will raise a "host not found" error if gethostbyaddr() fails (usually if there is no PTR record). That lookup is performed regardless of the value of Socket.do_not_reverse_lookup. Incidentally, what is the rationale behind requiring the presence of a PTR record? There are many hosts that do not have one, especially virtual web hosts, and I have found Socket/TCPSocket.gethostbyname to be fairly useless as a result (and instead resorted to using Resolv.getaddress[es]). Reimer Behrends