Linking A Custom Domain to Your Github Pages Website
Image generated using DALL·E
Here’s something I couldn’t find on the Github Docs guides. Their posts got me 90% of the way, so I’ll share the final 10% that I had to figure out separately.
Steps to link a custom domain to your Github website:
- Buy a domain (I used Godaddy).
- Create/code your website files and push them to your Github Repository. Here’s a great walkthrough post to do so.
- On github.com, log in and go to Settings > Pages > then add your domain to the “Custom Domain” input section, then save it. (This should create a CNAME record with your domain in it in your Github repository).
- On your DNS settings, change the CNAME from pointing towards yourdomain.com to your username.github.io domain.
- Add the four IP addresses as A records in your domain. You can find them in this Github Docs guide.
- Delete the A record that points to “Parked” that was auto created upon buying the domain.
I was able to find all this info online except Point #6.
On Godaddy, the default A record includes one that just points to “Parked.” My site wasn’t working until I realized I had to deleted that A record, as it was interfering with the others.
Figured I’d share it online in case anyone’s looking, as it took me a while to figure it out.
– Jan. 23, 2022