Search code examples
herokudnssubdomaincname

Using a domain name with both 'www' and witout 'www' with Heroku and Name.com


I have a heroku application that i am trying to use a real domain with. I have succeeded in using the domain name with the 'www'.

In the Heroku side, i have multiple domain names for my app, one with 'www' and one without.

enter image description here

In the name.com side, i have a CNAME record, of the host WITH the 'www' (as declared in heroku), and as an answer i have the corresponding DNS target.

My app only works with 'www'. I have experimented with many different combinations, both of CNAME and A records.

Is there a way to make it work with both and without 'www'?


Solution

  • I found the solution.

    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.