Author: James P. Roberts Date: To: Vadim Vygonets, exim-users Subject: Re: [Exim] Address rewriting vs. CNAME records?
> Quoth Greg A. Woods on Thu, Feb 06, 2003: > > If you're going to make foo.friends.dom an A record then you should make > > it an A record _and_ an MX:
> >
> > foo.friends.dom. IN MX bar.my.dom.
> > foo.friends.dom. IN A 10.12.13.14
>
> Yes, of course, I did that.
>
> > Don't forget to add the additional PTR(s) too:
> >
> > 14.13.12.10.in-addr.arpa. IN PTR bar.my.dom.
> > 14.13.12.10.in-addr.arpa. IN PTR foo.friends.dom.
>
> It will be done.
>
Don't rush on the in-addr.arpa PTR records. As far as I know, you need
only one, and it should point to the canonical hostname for that IP.
Additional PTR records for reverse lookups don't buy much, other than
extra book-keeping for you, and confusion for anyone looking up. Some
DNS servers will return only a subset of PTR records, in a random order,
for a given typical reverse-lookup query, in order to avoid sending very
large answers (i.e. to avoid triggering a TCP response when a UDP
response will do).
The vast bulk of reverse lookups are used to verify only that "at least
one" record exists. It would be impractical to sort through what could
be hundreds or even thousands of reverse lookup records for the same IP
(for example, from a large virtual domain server), especially when you
aren't guaranteed to get the full set with a single query. And the
order of multiple records returned for a PTR query is typically
randomized! So you really only need or want the one.
By the way, this is also why it is not practical to demand that a
reverse IP lookup return the same hostname as a forward lookup that
returns the given IP (say, for example, when doing reverse lookups at
SMTP time). As was pointed out, the same host may have multiple names,
and there is NO WAY to ensure that a given reverse lookup will return
the "right" one, and almost certainly not as the first record in the
response (if there were multiple in-addr.arpa PTR records for a given
IP). However, it is reasonable to expect that the hostname returned
from a reverse lookup, also forward resolves to the same IP.
That is, you can expect:
IP ==> hostname ==> same IP
but you CANNOT expect:
hostname ==> IP ==> same hostname
(it could happen, but is not required nor expected)
HOWEVER, if you take it one more step, you should expect:
hostname ==> IP ==> different hostname ==> same IP