When an A Record Matter’s

We’ve all configured A and CNAME records in DNS.  The common rule is to use a CNAME if possible for a service, and a single A record for a host.

Consider the following BIND configuration with a CNAME:

  • .           A              xx.xx.xx.xx
  • www     CNAME     @
  • .           MX           yy.yy.yy.yy

It’s a pretty standard setup with a web and mail server.  Take a look at this equally standard configuration with an A:

  • .           A            xx.xx.xx.xx
  • www    A            xx.xx.xx.xx
  • .          MX          yy.yy.yy.yy

Q: Where does mail for the domain (@domain.tld) go in these examples?

A: yy.yy.yy.yy as defined by the @ MX record

Q: Where does mail for www (@www.domain.tld) go in these examples?

A: yy.yy.yy.yy when defined by the CNAME record.  www.domain.tld resolves to domain.tld which delivers via the yy.yy.yy.yy MX record

-and-

xx.xx.xx.xx when defined by the A record. www.domain.tld resolves to the A record where mail will be delivered in the absence of a MX definition.

The summary is that although web request will arrive at the same location with either an A or CNAME entry, SMTP Mail will not without the addition of an MX record to the second configuration.

  • .           A              xx.xx.xx.xx
  • www     CNAME     @
  • .           MX           yy.yy.yy.yy
  • www     MX          yy.yy.yy.yy

Leave a Reply