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 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?

share|improve this question
    
You just set up your DNS entries to whatever you want. –  Michael Hampton Jan 15 '13 at 21:42
add comment

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
So there's no way to have the domain without the preceding www and the MX record too? –  Iain Feb 13 '13 at 18:01
add comment

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.