How to Point a Subdomain to GitHub Pages

You may recall, in a previous article, we explained how you can point a domain to GitHub to host a static site. In this article, we’re going to show you how you can do the same thing but for a subdomain.

There are many reasons why you might want to use a subdomain. You may want to use a subdomain for testing, or, you may already have a site on your primary domain and would like to point a subdomain to GitHub pages.

Whatever the reason, using a subdomain as a custom domain for GitHub Pages is easy to set up. Follow along with the steps below to see how you can do it.

How to Point the Subdomain to GitHub

In order to accomplish these steps you will only need access to cPanel. You also want to note the GitHub’s IP addresses you can use:


  1. Log into cPanel
  2. Create a subdomain (or us an existing one)
  3. Open the Zone Editor in cPanel
  4. Change your subdomain CNAME to an A Record
  5. Point the A record to the primary GitHub IP address:
  6. Add another A record for the same subdomain and point it to the secondary GitHub IP address:

Allow Some Time for Propagation

Now that you have pointed your subdomain to GitHub, you may need to wait a few hours for the records to propagate. If the site is not resolving after 24 hours you may want to double-check your input to make sure there are no mistakes in copying.

Was this article helpful? Let us know!