How to Use Your Own Domain For Github Pages


A Github Pages site is great for hosting a git project’s website but can also be used for your own personal site if you like. It is pretty easy to setup and is free. The url of the site will be which seems fine. This site is hosted on Github Pages and I have been pretty pleased with it in particular as https is always forced.

Browsing over the doco the other day I noticed that you can use your own domain with subdomain which sounded interesting. The details for setting this up are here - simple stuff if you can change your domain’s DNS records. The output dig output should look something like the following for my blog :

ewan$ dig +nostats +nocomments +nocmd

; <<>> DiG 9.10.6 <<>> +nostats +nocomments +nocmd
;; global options: +cmd
;		IN	A	300	IN	CNAME	2731	IN	A	2731	IN	A	2731	IN	A	2731	IN	A

However ended up with a github error page. A little further reading said that I needed to enable the custom domain on the github pages and voila now works once you add the custom domain name and check the https box.

github-pages-config screenshot