How to change a Heroku domain to a custom domain? How to change a Heroku domain to a custom domain? heroku heroku

How to change a Heroku domain to a custom domain?


1) Buy a domain from a domain-registrar (godaddy.com, networksolutions.com)

2) Add the domain to your heroku app => heroku domains:add

3) You'll see an option to alter DNS records on your domain service provider's account dashboard, add a "www" C-Name DNS record and point it to your heroku app (e.g. yourapp.herokuapp.com)


This article explains the process in detail:

http://lifesforlearning.com/heroku-with-godaddy/

Example using www.example.com for example.herokuapp.com

  1. In your heroku app use commands: heroku domains:add www.example.comheroku domains:add example.com

  2. Go to your Godaddy specific domain page.

  3. Clear all records you don't need. Add a CNAME record using www as host. For your target, go use command 'heroku domains' within your app and copy the url given for the www.example.com domain. Add an A record using @ as host and 50.63.202.1 as target (from documentation).

  4. You are done, however it will take time for this change to propagate. In the interim use forwarding. Scroll down to the bottom of the GoDaddy site and enter forwarding information using https:// or http://, example.herokuapp.com, permanent (301), and forward only. Don't click the checkbox to update DNS.


Please read their documentation to know more details about how to do that: https://devcenter.heroku.com/articles/custom-domains