Configure A Custom Domain Name For GitHub Pages

February 03, 2021

I registered for a custom domain name for my website on Without a custom domain name my GitHub Pages website would have been hosted at (i.e. <your-username> This did not bother me, I just wanted to try a custom domain name for fun plus it was free.

1. Configuring the custom domain name on GitHub

Inside the repository, click on the Settings tab. Scroll down to the GitHub Pages section. I entered my custom domain name in the “Custom domain” field and saved that.

custom domain

The above step created a commit that added a CNAME file to the root of my publishing source i.e. the root directory of the gh-pages branch.

2. Configuring the custom domain name on

On I created the following records under the Advanced DNS tab,

  • A CNAME record to point (i.e. my custom domain) to (i.e. the default domain of my GitHub Pages website).
  • Four A Records (with Host as ”@” i.e. root) for the Github A Record IPs:



Now my website hosted using GitHub Pages is available at!


  • GitHub Docs here.
  • support page here.

Made with lots of ♥️ and