1

Given something like this:

xxx.net.            CNAME    surrogate-xxx.net.
www.xxx.net.        CNAME    surrogate-xxx.net.
mail.xxx.net.       A        1.2.3.4
xxx.net.            MX       mail.xxx.net.

surrogate-xxx.net.  A        4.3.2.1 

Should mail for xxx.net go to 1.2.3.4, as directed by the MX record, or to 4.3.2.1, as directed by the A record to which the CNAME points.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
Ed Greenberg
  • 306
  • 2
  • 6
  • You probably have messed up the dots in your example - it looks like it should be xxx.net. (note the trailing dot). – the-wabbit Dec 16 '11 at 14:57
  • 1
    Most dns servers will not load this zone, as 'xxx.net' has "CNAME and other data' - namely the SOA, so it most likey won't get served. – Aaron Dec 16 '11 at 17:11

2 Answers2

6

Actually the zone as noted here is considered a bad practice. Defining a CNAME for the label xxx.net just "remaps" all RRs of xxx.net. to surrogate-xxx.net. including the MX record. Defining the MX RR for xxx.net. is asking for trouble. RFC-1034 has a clear statement on this topic:

If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical name and its aliases cannot be different. This rule also insures that a cached CNAME can be used without checking with an authoritative server for other RR types.

Further reading here.

the-wabbit
  • 40,737
  • 13
  • 111
  • 174
-2

Mail will flow to mail.xxx.net in that scenario.

Mail will flow to whatever the MX record(s) points to.

Now, if your MX record points to mail.xxx.net and mail.xxx.net points via CNAME to surrogate-mail.xxx.net, mail will flow to surrogate-mail.xxx.net. Your MX record points to an endpoint - how you define that endpoint - A record, CNAME, etc. is up to you.

Driftpeasant
  • 3,217
  • 2
  • 22
  • 28