Custom Domain for your Github pages

Yes, You can add a custom domain name for your Github page. You just need some basic knowledge of git and domain configuration.

Post Thumbnail

Prerequisites:

  1. You should have your own GitHub page, If not then this article might help you.
  2. You have your own custom domain name purchased and have access to domain configuration.

Step 1: CNAME

Create React app on your local & push it on Github/Gitlab/Bitbucket.

Before start, I assume you have your Github page up & running.

First, you need to create a new file in your repository as CNAME then add your domain/subdomain name & commit.

Custom Domain for your Github pages

Step 2: Configure DNS

Now go to your Configure DNS section of your DNS provider, You need to add two “@” type A records that point to the GitHub IP's

185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153

and one “www” CNAME record that points to your username.github.io URL.

Done! You did it! 🥳🍻

Custom Domain for your Github pages

For detailed information about the custom domain for Github, you can visit this article.

Heads Up: I am working on one of the cool Chrome extensions which helps to format your code easily & it's superfast It can format your code within milliseconds. on top of it, it’s completely free for use. So go & hit that Add to Chrome Button. https://chrome.google.com/webstore/detail/code-formatter/njpgcnaadikbannefjibknjopmogeidm