Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do CNAME records also forward MX requests?

Tags:

My DNS has a set up for the domain base.com that consists of A and MX records. There are several other domains that are set up with CNAME records, pointing to base.com. Do I need to set up anything special (like extra MX records) for the CNAME domains, or will the CNAME records also forward any MX requests.

Example:
Will an email sent to [email protected] be delivered correctly to the MX of base.com if these (and only these) DNS records are in place:

; A and MX set up for base.com
base.com.  3600  IN  A  123.45.67.89
mail.base.com.  3600  A  123.45.67.89
base.com.  3600  IN  MX  10  mail.base.com.
; CNAME set up for otherdomain.com
otherdomain.com. CNAME  IN  A  base.com.
like image 799
Jpsy Avatar asked Aug 30 '12 19:08

Jpsy


People also ask

Does CNAME override MX?

The CNAME will override your MX record.

Does CNAME conflict with MX?

A CNAME record conflicts with a TXT, MX, AAAA, A, or existing CNAME record, and all other records of this type conflict with an existing CNAME record. In principle, no further DNS records such as TXT, MX, A or AAAA records may be configured for an alias in a CNAME record.

Can you have a CNAME and MX record?

1 Reply. According to RFC 2181 you cannot point an MX record at a domain with a CNAME alias: The domain name used as the value of a NS resource record, or part of the value of a MX resource record must not be an alias.

What is the difference between MX and CNAME?

So, to summarize, A Records point directly to IP addresses, while CNAMEs point to A Records. MX records point to mail servers and help route emails to their proper destinations.


1 Answers

CNAME causes queries for all RR types (excluding CNAME itself) to be directed to the target name. That includes MX. So yes, the above zone data will cause queries for otherdomain.com.'s MX to resolve to mail.base.com..

Experiment with dig or your favorite DNS client. Not only will you confirm the result for sure, but you won't have to wait 4 hours for someone to answer your SO question before you get your answer!

Unfortunately, in this particular case, if your domain is really of the form otherdomain.com., you would not be able to configure a CNAME resource records for it. This is because domains that have CNAME records cannot have any other type of resource record at the same time. Yet if otherdomain.com. is directly below com. (or another gTLD), it is necessarily at the top of a zone and so it needs at least SOA and NS records.

like image 131
Celada Avatar answered Sep 20 '22 13:09

Celada