Here’s a boilied down method to configure add a custom domain (e.g., username.com) to your github pages website (e.g., username.github.io).

Step 1

Buy a domain (e.g., richpauloo.com). I used godaddy.com, but you can use any number of domain name registries.

Step 2

In your github.io repository Settings, add the domain you purchased in Step 1 to the “Custom domain box”:

custom domain with github pages tutorial

Make sure you do Step 2 before Step 3, for security reasons outlined in the Official Github docs.

Step 3

In your DNS Management console, add a CNAME record with the following parameters:

  • type = CNAME
  • name = www
  • value = username.github.io.
custom domain with github pages tutorial

Meaning: This tells your DNS to point www.username.com requests towards the site hosted at username.github.io. Set the TTL (time to live) to an hour or less.

Next, in your DNS Management console, add 4 separate A records with the following information:

  • type = A
  • name = @
  • points to (value) = IP
custom domain with github pages tutorial

For IP, supply the Github IP addresses that host your username.github.io site. As of writing (2019-11-15) these IPs are:

185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153

However the values might have changed since the time of writing. See the offical docs for the most up-to-date values.

Meaning: “A” records connect your domain name (hosted by your DNS) to the actual IP addresses where your site lives on a server (at Github).

Step 4

Nagivate to username.com to see your github page! Be patient if it doesn’t immediately show. This lag is related to DNS propogration.


Here are three resources I found helpful while doing this:

  1. Offical docs
  2. An unoffical guide.
  3. Nice explanation of A records