Adding a Custom Domain to a Github Pages Project Site

In the previous post I pushed generated static site content to Github Pages, to be served as

Not being a marketing expert (the opposite is the case), I do suspect that promoting that URL as my homepage would appear unprofessional. Rather,

This is remarkably simple nowadays. The Github Pages documentation is a little confusing: they only talk about user and organization pages, and not about project pages. There are numerous posts on the internet that suggest that adding a custom domain to a project page has been cumbersome in the past - these days are over, apparently. Following is what I did.

Configure a Subdomain,

  1. For the jfasch-home-pages project, configure a custom domain

    (Enforcing HTTPS also makes sense, while we are at it)


    All this does is to create a docs/CNAME; pull the changes,

    $ cd $HOME/jfasch-home-pages
    $ git pull
  2. Point to

    At your DNS provider, create a CNAME DNS record for and set its value to point to Wait a day before you publish the new site URL - it may take some time until the changes have propagated to other name servers. Check like so,

    $ dig
    ;            IN      A
    ;; ANSWER SECTION:     1100    IN      CNAME 3600    IN      A 3600    IN      A 3600    IN      A 3600    IN      A

    (Output stripped for brevity.) In the ANSWER SECTION you can see that (the trailing dot says this is a FQDN “Fully Qualified Domain Name”) is an alias (CNAME) for And btw., has four addresses (A).

  3. Done; surf to

Configure an Apex Domain,

We have the subdomain in place, pointing to our site; now we want to go to the same site. Github automatically, magically, apparently, redirects between apex and subdomains. Consequentially, it is just a matter of DNS configuration: at the DNS provider, arrange that points to one or more of Github’s static IP addresses (taken from the output of the above dig command). These are,

Go to the DNS provider, and arrange that the DNS address (A) record for points to one or all of these addresses.