Personal email address with 1and1 domain and Heroku hosting

Today I would like to talk about the CNAME record needed to use your own domain on Heroku.

If you want to use Heroku to host your website while using 1&1 as a domain provider you might encounter some issues like not to be able to use a custom email address like foo@yourdomain.com.

On their documentation page, Heroku asks you to create a CNAME record pointing the subdomain to your app’s Heroku herokuapp.com hostname.

Something similar to this:

Record Name Target
CNAME www example.herokuapp.com.

Pretty easy right? Yes, only if you don't use any of the services 1&1 provide. In my case, I use also 1&1 to have a custom email address as explained earlier. In this case you have to do more that just creating the CNAME record.

On Wikipedia, you can find this:

  • An alias defined in a CNAME record must have no other resource records of other types (MX, A, etc.).

-- Source: http://en.wikipedia.org/wiki/CNAME_record

But if you want to use the custom email address, you need a MX Record:

A mail exchanger record (MX record) is a type of resource record in the Domain Name System that specifies a mail server responsible for accepting email messages on behalf of a recipient's domain

-- Source: http://en.wikipedia.org/wiki/MX_record

One way I found to solve this issue was to use a third party DNS provider. In this article I will explain the steps using DNS Made Easy.

DNS Made Easy allows you to configure the CNAME records, MX records, A Records, ... very easily.

The Solution

For the rest of the article, we will only focus on how to configure 1&1 and DNS Made Easy to have your website and your email working. But it is not the only functionality provided by both.

Here is my solution (We assume you have an account on 1&1, Heroku and DNSMadeEasy):

DNS Made Easy
  1. Add your domain:

    DNSMadeEasy - Add domains

  2. Configure your MX record as follow:

    DNSMadeEasy - MX Records

  3. Configure your ANAME record:

    DNSMadeEasy - ANAME Records

We are done with DNS Made Easy.

1&1

To configure your 1&1 domain to point on your nameserver follow the instructions on this page: Use Your Own Name Server for a 1&1 Domain

On step 5, enter the first 4 nameservers you can find on your DNS Made Easy account. It should look like this:

DNSMadeEasy - System NS Records

Sources:

View Comments