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 have a Heroku app and a domain that maps to it. The host records are set up as follows: Domain setup

Now I want email to to be forwarded to my gmail account. I was told by the support for my domain name registrar that since I'm using CNAME records that's not possible as the MX records will be overridden by the CNAME records. Is that true? If so how can I work around it?

share|improve this question
up vote 3 down vote accepted

The naked domain cname problem is common. The dns specs do not allow you to redirect a naked domain. Because of this, many dns providers do not allow you to use a cname for @. Your dns providers way of making @ records use a CNAME must be interfering with other records.

Your workaround is as follows:

Google runs servers that do nothing but redirect naked domains to other domains (ie to In your Google Apps control panel, go to Domain Settings -> Domain Name, and follow the instructions to redirect your naked domain to In your dns settings, have them keep your www record, but change the @ CNAME record to an A record: give them the ip addresses provided to you by Google in their instructions. Have them add Google's MX records and you're set.

share|improve this answer
Is it possible to do this without Google Apps? I only have gmail. – Johnny Jan 3 '13 at 12:17
I don't think Google allows you to make emails to custom domains go to Google's MX servers and be sent to a address. If you don't want to get a google apps account because they recently stated charging money, you can get something similar through microsoft: – Edwin Jan 3 '13 at 18:02

As long as you have a CNAME for the base domain, you can't have an MX record for the same name.

There are two things you can do. You can either have a mail server on the server that the CNAME points to, and have that mailserver forward all mails to wherever it is you want it. This has the advantage that you can set up many different forwardings if you like.

The other option is to have record type A instead of a CNAME for the domain. Then you can add as many MX records as you like.

(Original, erroneous answer - please ignore! They're wrong. The CNAME record will be used only if the list of MX records is empty. See section 5.1 of RFC 5321.)

share|improve this answer
Their claim is that prevents them from providing a solution. It seems one of their customers had the exact same problem as me: – Johnny Jan 3 '13 at 11:11
I'm sorry, my answer was wrong - I was thinking of A-records instead of CNAME. I'm very sorry and will amend my answer. – Jenny D Jan 3 '13 at 13:13

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.