[EXIM] Any experts on gethostbyaddr() out there?

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Philip Hazel
Fecha:  
A: exim-users
Asunto: [EXIM] Any experts on gethostbyaddr() out there?
As a result of a recent discussion on this list, I've been working on
the host identification code in Exim. One of the things that I thought
ought to be done (which I finally got round to) was to to check that,
having looked up a host name from an IP address, the name found did in
fact have the original IP address associated with it.

Now, Exim looks up these things using gethostbyname() and gethostbyaddr().
I did this so that people could make use of /etc/hosts and other things
in addition to the DNS in a "standard" way. I have discovered that, on
Solaris 2 and Linux, if you call gethostbyaddr() with an IP address that
does have a PTR record, but the name given by the PTR record does not
have an A record pointing back to the original IP address, then
gethostbyaddr() fails. On Linux I can see the two DNS queries happening
quite clearly.

So, the question I want to ask any experts out there is: is this
double-check feature a "standard" part of gethostbyaddr() on all
versions of Unix? If it is, then there is no need for Exim to do its own
double check. [Of course, if the A record has already been looked up,
the extra double check doesn't in fact cost much.]

Anybody care to comment?

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



--
*** Exim information can be found at http://www.exim.org/ ***