In brief, the steps are as follows:
- Set up my user page arsturges.github.io
- Commit a file called CNAME with one line:
- Go to GoDaddy site to manage my URL
- Add an “A (Host)” record with “host” =
@and “Points to” =
- Add a “CNAME (Alias)” record with “host” =
wwwand “Points to” =
- Wait for changes to propogate.
Below i’ll go over these steps in detail.
1. Set up your user page at gitub.io
I’ll asume this is done. In my case, I set up a user page at arsturges.github.io. When I navigated to that page, the URL stayed as asturges.github.io (i.e., it didn’t redirect to anywhere).
2. Commit a CNAME file
I added a file called CNAME (all caps, no extension), with a single line
3. Go to Godaddy.com and set up two records
On the github.io custom URL instructions, this part wasn’t clear to me. For my page, I had to set an A record and and Alias record. First, navigate to the page where you can manage the domain that want to point to your github.io page. From there, click on the “DNS Zone File” tab to add records.
4. Create an A record
Add a single A record that points to 18.104.22.168. This is explained at https://help.github.com/articles/tips-for-configuring-an-a-record-with-your-dns-provider/
5. Create a CNAME record
Add a single CNAME record as follows:
That’s all I did with GoDaddy. I didn’t change anything else, including the Nameserver (NS) records.
6. Wait for changes to propogate
When the DNS updates, you should be able to navigate to your custom domain and see your pages.github.io page. You can check your work with the following command, and compare to my results:
$ dig andrewsturges.com +nostats +nocomments +nocmd ; <<>> DiG 9.10.3-P4-Ubuntu <<>> andrewsturges.com +nostats +nocomments +nocmd ;; global options: +cmd ;andrewsturges.com. IN A andrewsturges.com. 3328 IN A 22.214.171.124