DEV Community

Cover image for How to redirect your hosted GitHub page to a custom domain

How to redirect your hosted GitHub page to a custom domain

Christine Kim
Teach me internet!
Updated on ・2 min read

If you have your own domain, and a Github account, you could take advantage of redirecting hosted pages to your own domain.

This article is assuming that you already deployed your GitHub page at

For example, I have a website through Google Domains. Below is a screen shot of my custom domain.
Screen Shot 2021-06-04 at 10.33.04 PM

To point your GitHub page to your website, first add to your DNS records the url, CNAME record, and the IP addresses. CNAME means that it's a Custom Domain.

www , CNAME, and 'yourGitHubUsername' .

Next, add GitHub's IP addresses under the DNS - with an A record. The A indicates that it's an 'Alias'.
As of June 2021, the IPs are
Enter fullscreen mode Exit fullscreen mode

@ , A , and the above IP addresses.
You can double check here.

Lastly, under the Settings tab on your GitHub repo for your site, go to the Pages section.
In the custom domain field, put your custom domain (
It might take a little time for it to load
Congrats, you are now pointing your page to your custom domain!

You can also host pages.
By deploying through Github pages, that are not If you deploy using gh pages, you can add themto your DNS configuration.

For example, if I had, and deployed a page
add into your DNS configuration
books , CNAME, and 'yourGitHubUsername' .

Discussion (0)