Vedant Jain
The Product Guy

The Product Guy

Setting up a domain on Hashnode - with CNAME flattening

Setting up a domain on Hashnode - with CNAME flattening

Vedant Jain's photo
Vedant Jain

Published on Jan 13, 2021

3 min read

Subscribe to my newsletter and never miss my upcoming articles

If you are reading this, you have probably purchased your domain from and want to set up the domain on Hashnode. The problem is that doesn't support CNAME flattening. Of course, you can add an A record and lose on power caching provided by Hashnode.

Well, here is a quick, step by step workaround -

Step 1. Move to Cloudflare (free)

Signup on Cloudflare's free plan for individuals. Now, Cloudflare will ask for your domain, automatically fetch your current name servers from, and instruct you to remove these Name servers with Cloudflare's nameservers.

Step 2. Open the CPANEL on

Log in with your credentials and find the "My Account" options under your username, on the top right side.

How to open CPANEL on

Once the account settings page is open, enter your domain in the "Jump to Domain" field to open your Domain's CPANEL.

Opening CPANEL for domain in

Step 3. Updating the name server on CPANEL

  • Go to name servers
  • Remove all the old nameserver
  • Paste the name servers provided by Cloudflare
  • Save the records Now we are ready to use Cloudflare's free DNS, which provides CNAME flattening.

Nameserves on CPANEL

Step 4. Add CNAME record on Cloudflare

  • On the Cloudflare login, go to the DNS option.
  • Click on "add record" and select CNAME as the record type.
  • Add @ to the name field, this is your hostname. Setting the value as @ enables CNAME flattening. Set the corresponding value as
  • Now for Hashnode's CDN to take over, you have to turn off Cloudflare's CDN by clicking on the Orange icon under the "Proxy status" column. Once you click on it the Orange Icon will turn grey, with "DNS only" written under it.

Your record should look like this -

Cloudflare CNAME record to support CNAME flattening with domain

That's it 🎉. Everything is set up 🛠 and your blog has a great page speed 🚀.

Share this