view_headline

Mary Knize

Custom Domains with GitHub Pages and Namecheap

July 22nd, 2018

How to set up custom domains on GitHub Pages after buying a domain from Namecheap.

On GitHub:

  • Click the "Settings" button at the top of the repo page.
  • Scroll down to "GitHub Pages".
  • Choose "master branch" from the "Source" dropdown. (Or "master branch /docs folder" if you're fancy. I should be fancy.)
  • Add the custom domain to the "Custom domain" box and click the "Save" button.

On Namecheap:

  • In the Domain List, click the "Manage" button for the domain you added to GitHub pages.
  • Click "Advanced DNS" at the top of the page.
  • Change the CNAME Record to "captainpainway.github.io.". If you're not me, replace this with whatever your username is .github.io. Also, I'm not sure if you have to have the period at the end of the CNAME, but it's always worked for me. Note that you can't make any other changes to the DNS settings until the CNAME has been changed.
  • Now, delete any other records hanging out in there.
  • Click "Add New Record". Select "A Record". The Host should be "@". The IP Address should be 192.30.252.153.
  • Now do that again with the IP Address 192.30.252.154.

Now sit back, be patient, and wait for everything to populate. Within 24 hours everything should be working correctly.