gethostbyaddr: messages on Sun running resolver

Mike Pelletier stealth at caen.engin.umich.edu
Sat Mar 23 02:10:40 AEST 1991


In article <cornell.669203150 at texas> cornell at csl.dl.nec.com (Cornell Kinderknecht) writes:
>
>I'm running resolver libraries on a Sun server.  When I get mail from
>some sites or a telnet is done from some sites, I get a message similar
>to the following at the console.
>	gethostbyaddr: <host.name> != <ip.addr>
>Where <host.name> is the  abc.abc.abc.abc name
>and <ip.addr> is the 123.123.123.123 ip number.

I've gotten a similar problem from certain sites on a telnet service I've
been running on my Sun SparcStation...

>!= implies not equal however the ip number and host name that are given
>are indeed the correct corresponding ipnumber and hostname (they are 
>resolved correctly when you get ipnumber from hostname).

This puzzled me as well...  I managed to find out that the error results
from the following process:

gethostbyaddr takes the IP address of the incoming connection,
	say it's 35.1.2.3, and does a reverse lookup for it to get
	a hostname.
It then takes the hostname it got and does a forward lookup to
	get an IP address.

If the IP address returned by the lookup and the IP address of the connection
don't match, it logs the above error and drops the connection.  This could
result from an incorrect entry in the nameservice database, dynamically
allocated addresses, and particularly, spoofed connections, which is what
this process is trying to weed out.  I don't know of any way to get around
it aside from not calling gethostbyaddr(), does anyone else have suggestions?



More information about the Comp.unix.admin mailing list