Search code examples
herokudnssubdomaincname

Using a custom domain from name.com with heroku


I want to use a domain I bought from name.com to be the domain name to my heroku appliation.
This is what I did.

I added my custom name to my Heroku app. I copied the DNS Target that Heroku generated.

I then went to name.com and used a CNAME entry. In the HOST entry, I tried both '*' and 'www' (without the quotes). By both i mean, two different occasions.
In the TARGET entry, I used the DNS Target that Heroku generated.

Now, when I visit my_domain.com I get that this page does not exist.
When I visit www.my_domain.com, I go to the heroku domain, not MY app, and I get a message from heroku that there is nothing here yet.

I get the same results even if i use '*', or 'www' in the HOST entry (without the quotes).


Solution

  • I found the solution.

    On heroku, use two domain names for your app. One with 'www' and onw wihtout 'www'.

    Then, just make two CNAME entries, back on name.com. The one will be the Domain Name with the 'www' from Heroku, with the appropriate DNS Target. The one will be the other domain name, with its appropriate DNS Target.