How to set a GoDaddy Domain to Use Github Pages
We will walkthrough setting up your domain that is managed by GoDaddy to point to Github Pages. This involves signing into your GoDaddy account, updating the DNS, updating Github Pages settings, and letting the apply.
Sign into your GoDaddy Account. Select on the domain you want to update.
At the top, go to DNS > Manage Zones.
You may need to search and select the domain again. Otherwise, you should be on the DNS page. Below is a copy of mine. The red is required to redirect the root domain (Ex. keithweaver.ca). The non-red highlighted records are for redirecting sub-domains. Additional Github pages, and in this case, app.keithweaver.ca, and docs.keithweaver.ca. I’ve listed the IPs to be copyed.
18.104.22.168 22.214.171.124 126.96.36.199 188.8.131.52
Where did these IPs come from? Step 5 in the Github Pages documentation.
Open your Github repository that hosts the web project. Navigate to the
Settings tab. If you do not see a setting tab, you are not the admin of the project/organization. You must have your permissions increased. Once on the settings page, navigate to
Pages on the left.
Start by publishing your site. This involves selecting a branch that will be public. Once published, you can add a custom domain.
And that should have worked! If you encountered an verify domain error, see section below. Otherwise, jump to Next Steps.
Verify Your Domain
I received the following error:
The reason I received this error is most likely because my domain is already in use. I’ve used it across multiple projects. As well, the DNS is probably still updating.
Github does provide us with steps to resolve. Open your Settings in the top right corner. Navigate to “Pages” on the left side. You are under your account settings, not the repository settings.
Select Add Domain, it will give you some verification codes.
Open GoDaddy records and add the verification codes.
If you still can’t set the custom domain after it has been verified, then another one of repository’s is already using the same domain. You will find it, and remove that custom domain. I needed to go through old projects and remove the custom domain. This resolved it for me.
Your custom domain is all setup. The next steps are simple, you should be Enforcing HTTPS.
This will take a few minutes to apply, but you should confirm in the next hour that it’s enabled. You will need to manually check the checkbox. For confirming changes, I recommend using an incognito window to access your site. If you already had a website, it may be cached, and you might not see the changes immediately. You can also do a hard reload (CMD + Shift + R).
That’s it, thanks for reading!