Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

UPDATE: 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.

share|improve this question
have not worked with Heroku a lot, but my guess is they are doing DNS load balancing. Getting two different IP addresses does not mean you are not running your code. – n8whnp Jan 3 '13 at 13:05
And what does Heroku have to say about this? – Michael Hampton Jan 4 '13 at 7:23
I've clarified the question a bit, all the answers and comments are pointing in the same (wrong) direction, so there must be something wrong with my explanation... – iwein Jan 4 '13 at 7:24
Have you tried accessing the URLs from outside your company / with a different laptop? Because if I perform a WGET on both addresses I get the same content. – hot2use Jan 4 '13 at 8:49

This hostname have more that one IP and it is not an issue. I got different IPs on each dig query made to this hostname:

sgeorge-mn:~ sgeorge$ dig +short
sgeorge-mn:~ sgeorge$ dig +short
sgeorge-mn:~ sgeorge$ dig +short
share|improve this answer
yeah, I know, but the ips don't change that often for the host. I ran the commands multiple times and got the same ip for the same command for a couple of seconds at least. See the update to the question. – iwein Jan 4 '13 at 7:26
@iwein that could be the work of the OS's DNS cache – orip May 28 '13 at 8:10

Your DNS is properly configured, however the webserver you are referencing to is not configured to host the domain "".

To make the webserver host "" a "ServerAlias" must be configured in the apache configuration.

Reference ServerAlias in the apache documentation.

share|improve this answer

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

heroku domains:add
share|improve this answer
I did that already, but the http request gets served by the wrong host. – iwein Jan 4 '13 at 7:20

Your Answer


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.