Map Your Domain to GitHub Pages with GoDaddy |Video upload date:  · Duration: PT1M0S  · Language: EN

Step by step guide to point a GoDaddy domain to a GitHub Pages site with correct DNS records and HTTPS setup.

If you want your static site to wear a custom domain without paying for hosting or tearing out your hair this guide will show you how to map a GoDaddy domain to GitHub Pages. You get free web hosting and a certificate for HTTPS once the internet finally agrees to update its records. Spoiler alert GitHub Pages is the quiet hero of many side projects and blogs.

Prepare the GitHub Pages repository

Make sure your site branch is published and actually has files to serve. For a user or organization site push to the main branch named after the account. For a project site use the gh-pages branch or the branch set in Pages settings. Push the compiled static site or source that Pages will build so the service has something to look at.

Create the CNAME file in the repo root

In the repository root add a file named CNAME that contains only the custom domain you want to use. Examples are www.example.com or example.com depending on whether you want the www prefix. Commit and push the file so GitHub Pages knows what domain to expect. Yes this file really matters and no you cannot skip it because magic will not happen.

Update GoDaddy DNS records

Log into the GoDaddy DNS manager for your domain and edit the records. What you add depends on whether you want the apex domain or the www hostname to be the main address.

  • For the apex domain create A record entries pointing to the GitHub Pages IPs. Use all four IPs on separate A records
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
  • For the www hostname create a CNAME record that points to your GitHub Pages domain such as username.github.io

Save the changes and then go have a coffee or a small existential crisis while DNS updates. Propagation usually takes minutes to a few hours but sometimes the internet likes to move at snail speed.

Verify DNS and GitHub Pages

After you change DNS check two things. First verify the DNS records with tools such as dig or any online DNS checker. Second open the Pages settings in your repository and look for the green verified check next to the custom domain. If you see a warning read it and then read it again because DNS typos are common and merciless.

Common troubleshooting tips

  • If the apex is not resolving check that all four A records are present and have the correct IPs
  • If www redirects or does not serve check the CNAME target matches yourusername.github.io with no extra dots or slashes
  • Use dig or nslookup to confirm the records from multiple locations if you want to impress coworkers

Enable HTTPS in Pages settings

Once GitHub validates the domain the Pages settings will offer to provision an HTTPS certificate. Enable the HTTPS option and if you want extra safety check the enforce HTTPS box so all traffic is secure. Certificate provisioning is automatic but may take a few minutes to complete.

Quick checklist for success

  • Repository branch is published and contains site files
  • CNAME file at the repo root with the exact custom domain
  • A records for the apex pointing to the four GitHub Pages IPs
  • CNAME for the www hostname set to username.github.io
  • Verify with dig or an online DNS checker and confirm the green check in Pages
  • Enable HTTPS and enforce it if desired

There you go you have a mapped domain on GoDaddy serving a GitHub Pages static site with DNS and HTTPS configured. It will probably work on the first try and if it does not you now know where to curse and where to check. Happy deployment and try not to break anything important.

I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!

This is a dedicated watch page for a single video.