How to have two records for example.com both for MX and as CNAME for www.example.com

I have a CNAME record for www.example.com with value of www.example.com.herokudns.com, and also for example.com with the value of example.com.herokudns.com.

The problem is that I do not know how to make MX records for a mail server on my domain provider server without losing the above functionality.

If I try to create MX records, the domain provider server complains that CNAME exists for example.com and I must remove it. If I remove it and create records for MX as instructed by mail server provider, the mail starts working but browsing to example.com is not possible. Only www.example.com continues to work.

How I could solve this? I tried to google and read about CNAME similar questions here, but can't find any solution.

Upvotes: 1

Views: 210

Answers (1)

hmedia1
hmedia1

Reputation: 6180

This is a direct incompatibility with DNS based PaaS like Heroku which doesn't have a single static IP endpoint, and the nature of DNS. You do have options, but you need to assess how each one compliments or counters the very reason you chose an integrated platform like Heroku in the first place. Fortunately, there does look like there's some simple and effective solutions, depending on your exact configuration and providers:

The long and short of it is:

  1. It's not standard to CNAME the apex '@'

  2. Heroku explain that you need to use a DNS provider that supports CNAME functionality at the apex, or use sub-domains exclusively

  3. There's a good write-up on this specific topic here:

At face value, the PointDNS addon looks dead simple:

heroku domains:add example-domain.com

enter image description here

NOTE: I've never tried PointDNS and have no opinion of them at all. The suggestion is merely a copy/paste from a heroku article based on simplicity.

Upvotes: 4

Related Questions