Lucas Cohen

Linking A Custom Domain to Your Github Pages Website

Linking Domain (DALL·E)

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:
  1. Buy a domain (I used Godaddy).
  2. Create/code your website files and push them to your Github Repository. Here’s a great walkthrough post to do so.
  3. 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).
  4. On your DNS settings, change the CNAME from pointing towards yourdomain.com to your username.github.io domain.
  5. Add the four IP addresses as A records in your domain. You can find them in this Github Docs guide.
  6. 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