Faster loading for GitHub pages using custom root domains

Published on

I use a GitHub page to host my personal landing page ( and Gandi for domain and DNS services. After setting up my custom domain using the GitHub instructions here: I noticed that the page was taking ages to load... and sometimes not loading at all. I always blamed my network and didn't think too much of it, until today when I tweeted about it:

I got pointed to this page, which explains GitHub's move to use a CDN: - it seems that the best way to configure your DNS is to use an ALIAS record that points directly to Since Gandi don't support this (although it is on their wish-list), I moved my DNS to CloudFlare.

Now although CloudFlare still don't allow you to use an ALIAS record to point your custom apex domain to github, they do allow you to have a CNAME record on the root domain (see CNAME Flattening). So I did that, it was free and super simple:

  • Add your website, CloudFlare will then fetch your DNS configuration
  • I removed my two A records pointing to "" and ""
  • Added a CNAME (using the @ symbol to denote my root domain) that points to
  • I then updated my DNS Provider settings on Gandi, and that was it!

Other references that were useful to me: