Naked domain map + Gmail MX Records

Solution 1:

The rule about CNAME records is that they don't mean what you think they mean. They mean that the specified name is an alias of the target name for all record types, not just A records. So by CNAMEing example.com to ec2.example.net, you are saying that the MX record of example.com is the same as the MX record of ec2.example.net, which is not what you want. Because of this, names with a CNAME record cannot have any other record types assigned to it. Since the root of a delegated zone must have an SOA record, you cannot have a CNAME record at the root of a zone. Therefore you can CNAME www.example.com to your EC2 server, but you must use an A record for example.com.

Solution 2:

Yes, I can confirm that using an A record for the naked domain will allow your MX records to work correctly.

Here's a very helpful error message my dns provider gave me when I tried to use a CNAME for a naked domain. It helps explain why email stopped working when using a CNAME:

You may not assign a Mail Server to a domain name that was defined using a CNAME. This MX record would never be used by e-mail clients. A proper e-mail client will look for an MX record for 'example.com.s3-website-us-east-1.amazonaws.com' and use that. WARNING: Not all email clients understand how to do even this correctly. Therefore, you may receive only limited support if you choose to define 'example.com' using a CNAME, and then try to send email to '[email protected].