From: Peter Date: 2003-09-29T18:12:43+09:00 Subject: Re: TCPSocket.gethostbyname difficulties > Thank you for the important information. So there's something > different from your environment from mine, that makes lookup fail. > Could you tell me how your ruby (and socket extension) compiled? > By yourself, or installed from package? Compiled from sources using gcc 2.95. But isn't your environment different from mine anyhow because you use a different (set of) DNS server? Could you maybe see what 'host' tells you? [peterv@merlin] host noblepack.com noblepack.com A 205.178.141.161 [peterv@merlin] host 205.178.141.161 205.178.141.161 does not exist, try again If it tells you differently (and can do the reverse lookup), it's almost certainly a difference in environment, but not how ruby was compiled etc. BTW, a look at the source seems to tell me that a) socket.c does not call gethostbyname in the C libs, but calls getnameinfo and gethostbyaddr instead b) it tests the do_not_reverse_lookup flag, but not for deciding on doing the gethostbyaddr (it's always done). That call however does what people in this thread called reverse lookup if I understand correctly Adding some more info to the error message and recompiling socket.c and rerunning the example tells me the host is not found by the call to gethostbyaddr. Since the execution got to that point, I guess the forward lookup works fine. gethostbyaddr is also always called. I think your DNS server manages to do the reverse lookup while ours can't. Is that possible? I don't know anything about how reverse lookups work... Peter