Why bother mapping a domain to GitHub Pages
Because username.github.io is fine for hobby projects but not great for looking professional or less like a student who learned HTML yesterday. Pointing your GoDaddy domain to GitHub Pages gets you free hosting, automatic SSL, and less explaining to clients who ask if your site is safe to visit.
What you need before you start
- A GoDaddy account with the domain in your control
- A GitHub repository serving a Pages site that works at username.github.io
- Access to the repository settings or the ability to add a CNAME file
- Patience because DNS can be slow and petty
Prepare the GitHub Pages repo
Pick the repo and branch that will serve the site from the Pages settings, or create a CNAME file at the repo root with your full domain, for example example.com. The CNAME tells GitHub which repo owns the domain. Confirm your site is live at the default username.github.io address before touching DNS.
Choose the right DNS records for your domain
If you want the root domain, also called the apex domain, you will create A records. For a www subdomain you will create a CNAME record that points www to username.github.io.
Apex domain A records
Add these four A records in GoDaddy DNS for the root domain. Use one record per IP with the host set to @
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
www subdomain CNAME
If you prefer www, add a CNAME for host www and point it to username.github.io where username is your GitHub account or organization name. That keeps the www traffic routed to GitHub Pages correctly.
Update DNS in GoDaddy
Log into GoDaddy and open the domain manager, then edit DNS records. Remove or replace any conflicting A or CNAME records for the same host to avoid DNS drama. While testing set a low TTL so changes show up faster, then raise it back to normal after everything is stable.
- Replace old A records for the root if they point to something else
- Remove any duplicate records that will cause unexpected behavior
- Save changes and do a small victory dance
Wait for DNS propagation and enable HTTPS
DNS propagation can take minutes or a few hours depending on caches. Once your domain resolves to GitHub Pages open the repository settings and enable HTTPS. GitHub will request and install a certificate automatically when DNS is correct.
After the certificate appears turn on enforce HTTPS in the Pages settings so visitors always land on the secure version.
Troubleshooting tips that actually help
- If the site shows an error, double check that the CNAME file has exactly the domain and no extra whitespace
- Use dig or nslookup to verify DNS records from different locations, for example dig example.com or dig www.example.com
- If the certificate does not provision, wait and then verify DNS is correct. GitHub needs to see the right records publicly before it will issue SSL
- Make sure you do not have an A record and a CNAME for the same host, that is an instant conflict
Final checklist
- Repo serves site at username.github.io
- CNAME file or custom domain set in repo settings with your domain
- A records for apex domain pointing to GitHub Pages IPs or CNAME for www to username.github.io
- DNS changes saved in GoDaddy and propagated
- HTTPS enabled and enforce HTTPS turned on
Follow these steps and your GoDaddy domain should be mapped to GitHub Pages with a shiny SSL certificate applied. If something breaks, blame DNS caching and then check the records again.