Setting up Heroku DNS using cloudflare

Neeraj Singh

Neeraj Singh

September 26, 2022

Lots of folks know cloudflare for the DDoS protection, rate liminting etc services it provides. Here at BigBinary we also use cloudflare for DNS management.

DNS management is a free service by cloudflare. However on first glance it might not appear that it's a free service. Once we add a site then we see a screen like this. Here we need to remember to scroll down to see the free option.

cloudflare pricing page

Now let's see how we can map the DNS settings from heroku to cloudflare. We will look at both a standard domain name and then we will take a look at a wildcard domain name.

Standad domain name

We are hosting GitEmit using Heroku. We are letting Heroku manage the SSL for this domain.

After setting up domains in Heroku here is what we see.

Heroku DNS gitemit

In Cloudflare we can set it up using two CNAMEs. It looks like this.

Heroku DNS

Wild card domain name

We are hosting NeetoChat application using Heroku.

Since it's a wild card domain we had to generate the certificates ourselves.

After setting up domains in Heroku here is what we see.

Heroku DNS NeetoChat

In Cloudflare we can set it up using three CNAMEs. It looks like this.

Heroku DNS

If this blog was helpful, check out our full blog archive.

Stay up to date with our blogs.

Subscribe to receive email notifications for new blog posts.