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.
The CNAME will override your MX record.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With