Adding domain for your github project

I have a problem. Each time I want add domain to my custom github project I forget what I should do exactly. That’s why I want to post this SO answer in my blog. I hope it would helpful not only for me.

To Setup a custom domain for your gh-pages project repo that handles and (assumes you already have a gh-pages branch on your repo) you need this:

  1. From your project repo, gh-pages branch. Create a CNAME file with the contents
  2. In your DNS manager, setup two CNAME records. One for the root apex (@) and one for www. Both point to If your DNS provider does NOT support ALIAS records on the root apex (@), simply create A records that point to and

After that wait til your name servers update:

dig +nostats +nocomments +nocmd

Original link: