1

I asked a question on why my custom domain with Heroku was not working here: Why can’t my custom domain on Heroku be resolved?

However, the background of this question was, that I wanted to have a CNAME entry for www.example.com pointing to heroku, while pointing mx.example.com or mail.example.com to a mail service.

In the Heroku docs, I can find any pointers if this is possible, or what aspects to consider. How would I setup my DNS entry for this context?

poseid
  • 529
  • 3
  • 10
  • 20

1 Answers1

1

The setup you are suggesting is possible and is suggested over pointing a root domain at Heroku.

To achieve this you would simply create these DNS entries, in this example these mail mx records are for Google apps but the solution applies to any such mail service.

  • CNAME Record with the name 'www' and the value 'your-app-name.herokuapp.com'.
  • MX record with the name 'example.com' and the value 'ASPMX.L.GOOGLE.COM'
  • MX record with the name 'example.com' and the value 'ALT1.ASPMX.L.GOOGLE.COM'
  • MX record with the name 'example.com' and the value 'ALT2.ASPMX.L.GOOGLE.COM'
  • MX record with the name 'example.com' and the value 'ASPMX2.GOOGLEMAIL.COM'
  • MX record with the name 'example.com' and the value 'ASPMX3.GOOGLEMAIL.COM'

Depending on your DNS host it might be that you have to use an '@' instead of 'example.com' when creating your MX records.

If you want 'mail.example.com' to point to your hosted mail service you might add a further CNAME record such as:

  • CNAME Record with the name 'mail' and the value 'ghs.google.com'.

All the best.

webjames
  • 126
  • 1
  • So there's no way to have the domain _without_ the preceding www and the MX record too? – ian Feb 13 '13 at 18:01