I have a Heroku app and I've add a CNAME (www to herokuapp) to redirect it from GoDaddy to Heroku. Now I'm trying to manage also the naked domain.
This is from Heroku documentation.
Naked domains (also known as bare domains or apex domains, for example mydomain.com) must use DNS A-records. To setup your root domain, add separate A records for each of the following addresses using your DNS management tool:
75.101.163.44
75.101.145.87
174.129.212.2
Check that your DNS is configured correctly with the “host” command:
$ host example.com
example.com has address 75.101.163.44
example.com has address 75.101.145.87
example.com has address 174.129.212.2
I've also activated the forwarding from the GoDaddy main menu.
Ok, if I try host example.com with my domain, all is ok. But, when I try with the browser, I get this:
Heroku | No such app There is no app configured at that hostname. Perhaps the app owner has renamed it, or you mistyped the URL
I tried also with the command heroku domains:add yourdomain.com
but this create a second instance of my app, it doesn't redirect it to the full domain www
Heroku only provides CNAME records and ANAME or ALIAS records GoDaddy does not have. You can add Custom Domains on the Heroku site, but the domain format isn't clear, should I add the www subdomain and the “naked” domain, one, or the other?
Navigate to the project folder from the terminal then type "heroku domains:add www.yourdomain.com". The domain name is the one purchased from GoDaddy. Next, log into your GoDaddy account and find the domains area in the upper left navigation tab. The domains tab will allow you to choose a domain then launch.
Godaddy sideGo to MyDomains > Domain Settings > DNS Management. Click edit the mentioned CNAME with the name 'www' below and set the value to your Heroku deployed address without copying the 'Http://www. ' part. Fo my app, that would be my-lovely-app.herokuapp.com.
Heroku highly advises against using A-records to point domains at cloud apps. Using A-records increases the chance of instability for DNS resolution. Heroku goes into details here.
Instead, you should redirect your naked domain to the 'www' subdomain. You can refer to this SO thread for more details on how to set that up on GoDaddy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With