3

As far as I understand, a CNAME record is served to retrieve only the A record of its destination. E.g.:

www.example.com CNAME domain.com

Here the DNS resolver will search for the A record (IP address) of domain.com.

It is not allowed by RFC to use the CNAME record for the bare domain name, although, technically, it is possible. Like here:

example.com CNAME domain.com

example.com MX mail.example.com (MX will not work in this case)

However, I still don't understand how this record conflicts with other records like MX from the technical point of view and why the A record does not conflict, for instance. I guess I've missed something.

By the way, there are CNAME Flattening, ANAME or ALIAS records that have different implementations than the standard CNAME and they do not conflict with other records.

Could you explain?

3

An entry of type:

alias.example.com. CNAME canonical.example.com.

means that all records for alias should be fetched from canonical. If you are looking for alias's MX record, you should retrieve canonical's MX record instead. Therefore mostly all other records for alias will be ignored.

This behaviour is semantic, not technical. You can still ask for alias's MX record, but the server will answer with the CNAME record instead.

The exception of the above rule is DNSSEC records. An RRSET for alias will not be ignored, since it certifies the CNAME record authenticity.

  • 2
    "You can still ask for alias's MX record, but no client will do it." On the contrary, all clients will do it. A client can not know in advance there is a CNAME. So it will ask whatever record it wants, and will learn there is a CNAME in the reply and then do the query again to go further (this is done in the recursive namesever). – Patrick Mevzek Dec 18 '19 at 12:47
  • Thanks for the correction, I edited the answer accordingly. – Piotr P. Karwasz Dec 18 '19 at 16:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.