This article goes through the process of setting up a custom domain for a github pages website.
This article assumes that you already have a github pages website up and running. Mine is klugjo.github.io.
In order to use a custom domain, you need to let Github know about it with the help of a CNAME file:
- Create a file names
CNAMEat the root of your website. The file name has to be all Caps.
- Inside that file, input your custom domain name without
My CNAME file contains:
- Commit and push your changes
That is it for the configuration on the github side.
You can contact your DNS provider for help on how to configure an A record but this is how I configured mine:
CNAME record for www is set to klugjo.github.io. The role of a CNAME record is to map a name to another name. Useful when the IP address of the host is not know or not stable.
The URL record is set to http://www.codeblocq.com in order to redirect all traffic to the www site.