CNAME records having MX

smoot at tic.com smoot at tic.com
Sat Dec 15 00:00:41 UTC 2001


> Derek Balling <dredd at megacity.org> said:
> 
> On 12/14/01 2:58 PM, "Joseph S D Yao" <jsdy at center.osis.gov> wrote:
> 
> > 
> > On Fri, Dec 14, 2001 at 09:54:08PM +0000, glen herrmannsfeldt wrote:
> >> Michele Chubirka <chubirka at gwu.edu> writes:
> >>> Is it true that a CNAME record can't have an MX record associated with it?
> >>> Am I remembering this correctly?
> >> 
> >> A CNAME can point to an MX, that is fine.
> > 
> > nope.
> 
> Yes, it can. This is perfectly fine:
> 
> foo     IN  MX  0   mail
> mail    IN  A       192.168.1.10
> bar     IN  CNAME   mail

This is correct.  The confusion is,  that CNAME's do not point at a 
specific RR - they point at a domain name.  The domain part of an MX record 
should be a domain name which does not have a CNAME record.  BIND 4 and BIND 8 
had relaxed rules about this point, but it violated the defining RFCs.  For 
example, you could have:

$ORIGIN foo.com.

abc    IN A 192.168.1.1
smtp IN CNAME abc
@        IN MX 10 smtp

BIND 4 and BIND 8 would warn about the target of an MX record being a
CNAME, but allow it.  The real issue here is performance and reliability.
Retrieving an MX record causes the target of the MX to be looked up
and returned in the Additonal Information section of a query response.
A CNAME does not cause this additional information to be looked up.
So the client will need to issue an additional query to get the target
of the CNAME.  See RFC 2181 for why this is an issue.  The same issue
holds for the target of an NS record.

This should be:

$ORIGIN foo.com.

abc    IN A 192.168.1.1
@        IN MX 10 abc

This eliminates the CNAME indirection.

-- 
Smoot Carl-Mitchell
Consultant






More information about the bind-users mailing list