GitHub Pages is an incredibly simple, user-friendly solution for hosting a simple personal website. By default the address will be Below, I’ll explain how I set up my user page with my own domain name that registered trough

Set up your user page and register a domain name

I’ll assume this is done. In my case, I set up a user page at When I navigated to that page, the URL stayed as (i.e., it didn’t redirect to anywhere). Also, through, I registered the domain name Now I want to point the custom domain name (in my case is - to my GitHub page.

Commit the CNAME file to GitHub page

a) Log in to your GitHub Account.

b) Go to the root of your page directory, in my case is -

c) Create a new file named CNAME (all caps, no extension).

d) Put the domain name in your file, in my case is - (without http://, only apex domain or with subdomain like www.).

e) Commit and push your changes.

Note: You can use a subdomain www. together with an apex domain. This is configured using the CNAME file. For example:

  • If your CNAME file contains, then will redirect to
  • If your CNAME file contains, then will redirect to

Note: By similar way you can add the file robots.txt to your GitHub page.

Configure the DNS in GoDaddy

a) Log in to your GoDaddy Account.

b) Go to “Manage Your Domains”.

c) Choose the domain name that you want to point to your page.

d) Click on the “DNS Zone File” tab.

e) Under the “A (Host)” section add a two A-records:

  • First: “A (Host)” record with host = @ and Points to =
  • Second: “A (Host)” record with host = @ and Points to =

This is explained there.

f) Under the “CName (Alias)” section add a “CNAME (Alias)” record with host = www and Points to = (in my case is

g) Save changes.

That’s all I did with GoDaddy. I didn’t change anything else, including the Nameserver (NS) records.


Changes require some time and do not take effect immediately. Patiently wait for your DNS settings to update. It can take up to 48 hours.

When the DNS updates, you should be able to navigate to your custom domain and see your page, but now with custom domain name.

You can check your work with the following command:

dig +nostats +nocomments +nocmd
;   73  IN  A   73  IN  A


That’s it, you’re done. Now you have your custom domain name added to GitHub pages. So simple isn’t it?

I hope this article has helped you learn how to add a custom domain name to GitHub pages. If this article helped you then please leave a comment :smiley:

Thanks for reading!