Using CNAME record as domain alias stops email

I have several domain names that point to the server, which has a different primary domain, via A records. Due to a forthcoming server move I didn’t want to have to change every IP address. So I tried substituting a CNAME record with the target of primary domain.

The website is accessible as expected but mail doesn’t get through. It says that CNAME flattening is in use so there shouldn’t be any difference?

Is is possible to use MX records on an alias domain with CNAME records?

Hi @mawigmore,

Your MX records need to point to a :grey: hostname and not just your root domain that’s most likely proxied. You could have one unproxied mail A record on the main domain and point all the other MX records there. You shouldn’t point your MX record to a CNAME (RFC 2181).

1 Like

Thanks, that makes a lot of sense. Unfortunately they have started moving the servers around and I can no longer test it!

How does this affect the SPF record please?
v=spf1 ip4:x.y.z.72 ip4:x.y.z.220 +a +mx +ip4:l.m.n.48 +ip4:l.m.n.43 ~all
(xyz and lmn are substitutes for the actual values.)