Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to map a naked domain (i.e., instead of to my EC2 server. I also have gmail setup on my domain.

A few weeks ago I attempted to map this together using CNAME to map to my EC2 URL. My email stopped working and it took some time to get back online; thus, I want to be extra careful to ensure I don't have an error if I try this again.

I have a static IP mapping to my EC2 server now. Thus, it is my understanding that the following host records will work:

-A record to @ host name ( which points to my static IP address on AWS. -Maintain my gmail MX record settings.

Can anyone confirm that this is the right way to set my domain settings and that email will continue to be correctly routed?


share|improve this question

migrated from Apr 26 '11 at 16:22

This question came from our site for professional and enthusiast programmers.

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 '' 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 '' using a CNAME, and then try to send email to '

share|improve this answer

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 to, you are saying that the MX record of is the same as the MX record of, 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 to your EC2 server, but you must use an A record for

share|improve this answer

The setup that you have mentioned for the DNS Zone is correct, the @ A record pointing to your EC2 server IP leaving the Google MX records pointing to the correct Google email server hostnames.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.