[NTLUG:Discuss] Bug in gethostbyaddr?

Rick Cook rcook at ntlug.org
Sun Mar 14 01:47:01 CST 2004


On Friday 12 March 2004 09:57, Neil Aggarwal wrote:
> Hello:
>
> I am trying to use gethostbyaddr to find the reverse DNS entry for
> the IP 216.234.230.2 but it gives me back a null result.
>
> When I do a dig on that IP, I get many results.  Is that throwing
> off gethostbyaddr?
>
> I have tried this on RedHat 9 and Fedora Core 1 and they both
> act the same.
>

Using your code as provided, I got =>

$ ./gethost
Checking  216.234.230.2
Got back mail.ppadot.com
Checking  207.229.77.210
Got back 207-229-77-210.cortland.com

This was on Debian/unstable powerpc:


When I started composing this message, I tried again and got:

$ ./gethost
Checking  216.234.230.2
Hostentry is null
Checking  207.229.77.210
Got back 207-229-77-210.cortland.com

then a few seconds later:

$ ./gethost
Checking  216.234.230.2
Got back mail.ppadot.com
Checking  207.229.77.210
Got back 207-229-77-210.cortland.com


dig -x 216.234.230.2 (or host 216.234.230.2) gives only mail.ppadot.com.

Earlier, I got a whole long list.



Rick



More information about the Discuss mailing list