How do CNAME and A records interact (in this weird case)

iwein asked:

I’ve managed to surprise myself with some DNS configuration. This is the actual output of my terminal:

[]$ host is an alias for has address

[]$ host has address

The result is that if you browse to, you do not get the content served by

I’ve used as an alias for And I want the mails to keep showing up at my Google Apps account. For that reason I’ve kept the A and MX records, but just changed the CNAMES to point to another server.

Why doesn’t this resolve to the right heroku app?

I understand that heroku doesn’t return the same IP each time and I understand that that’s not a problem. The problem is that the http requests serve content that is coming from a different dyno than the one aliased. If you check against you’ll see a different index.html being served.

My answer:

Nothing is wrong with your DNS setup. You need to tell Heroku about the hostname you want to use.

heroku domains:add

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.