I recently linked my GitHub page (jlefortbesnard.github.io) to a custom domain (jeremylefortbesnard.de). I bought it on namecheap.com since it is actually quite cheap.
I did have troubles matching them so here is what worked for me:
Create your GitHub page link
Buy a custom domain (I bought mine on namecheap.com for 6$ but you can find one for even cheaper)
In GitHub, create a document named “CNAME” in your GitHub page repository (i.e., inside your repository which ends with “.github.io”). Inside this document, write your domain name only (the one you just bought) without the www (e.g., I wrote “jeremylefortbesnard.de” for mine)
In namecheap.com, go to “domain list”, tick your domain and select “manage”. Now, click on “Advanced DNS”. There, delete any existing information and add the four GitHub IP’s as “A record”, “@”, and the IPs like in this picture:
Right now, in summer 2018, it is these four IP’s:
But make sure there isn’t any update of these GitHub IPs there (scroll down until “Configuring A records with your DNS provider” and check the IPs)
Take a look at this video if you need help at this point.
- Still in namecheap.com, add the “CNAME record” with “www”, then your GitHub page repository name + a period at the end (jlefortbesnard.github.io. for me). It should finally look like this (with nothing else):
Once it’s done, check that the DNS was well propagated: go on DNSChecker, add your domain name and click on “search”. There shouldn’t be any red cross. It can take up to 24h. I suggest you wait for a day and contact namecheap if it’s still not propagated after 24h. Their online chat is quite efficient.
In GitHub, in your GitHub page repository, remove and re-add the CNAME file: click on “Settings” then scroll down until the “GitHub Pages” area and finally, in the box “Custom domain”, delete, re-enter your address (the new one) and save.
That’s it, well done!