This tutorial explains how to connect a custom domain registered with Namecheap to a GitHub Pages repository in GitHub.
- GitHub Pages Setup
- Namecheap Setup
If you've not yet created a repository for your site, log in to your GitHub account and create a new repository. Name the repository
<user-name>.github.io – for example,
From your GitHub repository, click on Settings and scroll down to the second-to-last section called Github Pages. In the Custom Domain box, enter the domain you registered with Namecheap, and click Save.
Note that when you return to your repository's Code tab, a new file will have been created called
CNAME. This file will include one line of code with the domain you added in the previous step – for example,
If you've not yet registered your domain with Namecheap, do that now.
Once you've registered your domain, navigate to the Domain List and click on Manage to the far right of your domain name. From there, click on the Advanced DNS tab. Click Add New Record to add each of the following five records:
Click Save All Changes and delete any additional records that may conflict with those you've just entered.
That's it! It should take approximately 30 minutes for the changes to go into effect. Once they do, you will be able to access the content in your GitHub Pages repository from the custom domain you registered with Namecheap.