Using a custom domain with GitHub Pages


It took far too long to work out how to do this on the GitHub help pages...

Assumptions:

Instructions

  1. Enable custom domain in your repository (settings).
  2. Update your A record to point to IP addresses: 192.30.252.153 and 192.30.252.154. Pro-tip: Switch your DNS management to cloudflare if you want super fast switch from your old hosting to GitHub.
  3. echo "your-domain-name" > CNAME in the default branch repo. This will be source if you're doing this for a Cobalt site.


Tweet