Heroku with GoDaddy

Asif Ahmed

So you have hosted your app on Heroku and you bought a domain name from GoDaddy. Now how would you connect the two? Let’s go over the steps on how to do this. There are a couple different parts.

  1. Go to the terminal and add the Godaddy domain to your Heroku app. From the command line enter the following (more info here – https://devcenter.heroku.com/articles/custom-domains):

  2. Sign into your GoDaddy account and go to the domains area. Then in the upper left hand navigation, hover over DNS and then click DNS manager. See picture below -

    DNS Record

    GoDaddy Dashboard

  3. Then click on your domain name to view the DNS file related to it.
  4. Then remove all records here except for the NameServers
  5. Add / edit the CNAME record for “www” to point to your Heroku app domain name like “example.herokuapp.com”. Mine is madpad.herokuapp.com.
  6. Then you have to set the A host to a specific IP address – 50.63.202.1. This is from the GoDaddy documentation found here.
    DNS Zone File

    Steps 5 / 6

    Now that you have completed this step, once the DNS propagates (it takes like 1-2 hours, but may takes as long as a day), you still can’t reach your app.to reach your app at www.your-domain.com. For example at this point I was able to reach my app at www.madpad.me.

Now let’s configure it so that your-domain.com will also work if you type that into a browser. Now back on the main domain page for your domain (see picture), click on “Manage” under “Domain” right by “Forwarding”.

Main DNS settings

Main DNS Page

Then add a 301 redirect to forward your domain to www.your-domain.com. Make sure this is of type -“Forward only”!

Forwarding Configuration

Forwarding Configuration

Now you should be done! Once DNS propagates, you will be able to reach your app at your-domain.com and www.your-domain.com. Congratulations and let me know if you have any questions.

For further reference check out this Stack Overflow link.

  • http://www.andysfilmblog1.com Andy D

    Thank you for this!! It was very simple to follow and finally something that worked!
    Also, nice idea with madpad :-)

  • Dylan

    Thanks for the post, I’m currently waiting for the DNS to propagate but I followed all the steps so it should work.

    One important thing to note, it looks like the GoDaddy url provided is displaying a different ip address than the one you mention in the article. They must’ve changed it on their end.

    • Asif Ahmed

      Thanks mate! I changed the IP to match the new one.

  • http://proxy.heroku.com Ramraj

    It Worked, Nice article

  • http://www.tubegether.com Rogue P

    Currerntly I have done all the steps and when I go to my tubegether.com or http://www.tubegether.com, it simply fowards it the tubegether-app.herokuapp.com

    • Asif Ahmed

      Hello Rogue,

      Were you able to get it working? What other steps did you follow to get it working?

      The article is a little old, so the information may be a little outdated.

    • Arthur Moore

      Probably resolved a while ago, but just in case others read this and have the same issue. Simple forwarding will do just that, it more or less sends you to heroku. Select with Masking. This does that, but masks the Heroku site with your domain, so it will appear as if the host is GoDaddy

  • Michael

    Awesome, you saved my day and night.

    THANK YOU

  • Juan Carlos Alemany

    Hi Asif, nice article, I did everything you posted, but the site says “This website is temporarily unavailable, please try again later” Is there’s any step I need to do on Heroku?

    Thanks for your help

  • jafet gonzalez castillo

    Thanks

  • https://github.com/hyip Hyip

    We can even assign only the ‘your-domain.com’ when the domain’s dns provider (or NameServers) support ALIAS or ANAME for the @ Record to ‘example.herokuapp.com’ without CNAME ‘www.your-domain.com’ to it. It will let you to point ‘www.your-domain.com’ to other hosting separately.

  • Devon Kiss

    Thanks so much for the help!