Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 admin@mydomain.com 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

2 Answers 2

up vote 2 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 yourdomain.com to www.yourdomain.com) In your Google Apps control panel, go to Domain Settings -> Domain Name, and follow the instructions to redirect your naked domain to www.yourdomain.com. 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
1  
I don't think Google allows you to make emails to custom domains go to Google's MX servers and be sent to a @gmail.com 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: domains.live.com –  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 ietf.org/rfc/rfc2181.txt prevents them from providing a solution. It seems one of their customers had the exact same problem as me: community.namecheap.com/forums/viewtopic.php?f=6&t=3172 –  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

 
discard

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.