DNS using CNAMEs breaks MX records?

Solution 1:

This is a common error. You cannot use a CNAME RR for your root domain (e.g. company.com) and define additional resource records for the same zone.

See Why can't I create a CNAME record for the root record? and RFC1034 section 3.6.2 for details:

If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical name and its aliases cannot be different.

Solution 2:

RFC2181 section 10.3 says you can't point your MX record to a CNAME:

The domain name used as the value ... of a MX resource record must not be an alias.

Solution 3:

I just moved to Heroku which uses CNAMEs instead of A records and what I had to do was instead of making a CNAME with my_domain.com pointing to heroku, I did the CNAME with www.my_domain.com pointing to heroku, so the bare/root domain was not forwarding and my MX records would still work. Then I added a pointer to redirect my_domain.com to www.my_domain.com. It seems to work great. In my domain name provider the pointer was created using a 'pointers' setting which I set to 'standard' 'URL' and 'www.my_domain.com'