How to connect GoDaddy domain with Heroku and Cloudflare

spyker77

Evgeni Sautin

Posted on June 28, 2020

How to connect GoDaddy domain with Heroku and Cloudflare

Well, if you (as me just recently) struggle to connect newly registered domain from GoDaddy with your app at Heroku, and in addition would like to use advantages of Cloudflare – this article is for you 🎯

Though you can find some useful information on the web, nothing worked for me out of the box and since I don't do this procedure on a daily basis, it wasn't obvious where is the mistake. Hope it will help you and without many words, let's jump in!


Sections

👉 Heroku settings
👉 Cloudflare settings
👉 GoDaddy settings


Heroku

Step 1: Go to your app's settings on Heroku.

Heroku - Settings

Step 2: Scroll down to the domains section and click "Add domain".

Heroku - Domains

Step 3: Enter your domain name that you've got from GoDaddy and click "Next".

Heroku - Domain Name

After clicking "Next" you'll be given a "DNS target" record that you need in the next steps.


Cloudflare

Step 1: Go to the "DNS" tab of your site and click "Add record" in DNS management section.

Cloudflare - DNS Section

Step 2: Enter two CNAME records. First has the name of your domain and target – is your "DNS target" record from last step at Heroku. Second CNAME record must have the name of www and the same targer record from Heroku. In order to finish with this tab, copy provided nameservers as you gonna need them soon.

Cloudflare - DNS Records

Step 3: Go to the "Page Rules" tab and let's add redirect from www address to the main clean one. For example, in my case www.skillhunter.app redirects to skillhunter.app. Pay attention to asterisk (*) character in the first record and trailing $1 in the last one.

Cloudflare - Page Rules


GoDaddy

Step 1: From your product's page click on "DNS" related to your domain.

GoDaddy - Products Page

Step 2: Now you should see DNS records similar to the following.

GoDaddy - DNS Management

Step 3: Scroll down to the Nameservers section and click "Change".

GoDaddy - Change Nameservers

Step 4: Click the phrase "Enter my own nameservers (advanced)".

GoDaddy - Enter Nameservers

Step 5: Enter the nameservers, that you've copied at step 2 of Cloudflare settings and click "Save".

GoDaddy - Save Entered Nameservers


Congrats 🎉

You did it! Just don't forget to wait, as DNS records update may take up to 72 hours.


Last but not least, big shout out to Clint Adair from Unsplash for cover photo!

💖 💪 🙅 🚩
spyker77
Evgeni Sautin

Posted on June 28, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related