Email forwarding and CNAME records

8,529

Solution 1

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.

Solution 2

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:
8,529

Related videos on Youtube

Johnny
Author by

Johnny

Updated on September 18, 2022

Comments

  • Johnny
    Johnny over 1 year

    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 [email protected] 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?

  • Johnny
    Johnny over 11 years
    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
    Johnny over 11 years
    Is it possible to do this without Google Apps? I only have gmail.
  • Jenny D
    Jenny D over 11 years
    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.
  • Edwin
    Edwin over 11 years
    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