How to Connect a Namecheap Custom Domain to GitHub Pages (4 A Records + HTTPS)
Hosting a developer portfolio, open-source documentation site, or Astro/Hugo static blog on GitHub Pages for $0/month? Add these exact four A records and one CNAME record in Namecheap Advanced DNS to unlock custom HTTPS.
Last verified: November 15, 2026 · 5 min read
What are the exact Namecheap DNS records for GitHub Pages?
Point your apex domain (@) on Namecheap to GitHub Pages’ four official IPv4 A records (185.199.108.153, 185.199.109.153, 185.199.110.153, 185.199.111.153) and add a CNAME record for "www" pointing to <your-username>.github.io.
| Record Type | Host | Value / Target | TTL |
|---|---|---|---|
| A Record | @ | 185.199.108.153 | Automatic |
| A Record | @ | 185.199.109.153 | Automatic |
| A Record | @ | 185.199.110.153 | Automatic |
| A Record | @ | 185.199.111.153 | Automatic |
| CNAME Record | www | yourusername.github.io. | Automatic |
Grab a Developer .COM ($5.98), .ME ($4.88), or .XYZ ($2.00)
Pair free GitHub Pages hosting with a custom portfolio domain and free lifetime WHOIS privacy.
How to prevent custom domain takeover & enable Enforce HTTPS
Add a domain verification TXT record under GitHub Account Settings → Pages (_github-pages-challenge-username) before publishing so nobody else can claim your domain if you ever rename a repository.
- Verify domain ownership in GitHub User/Org Settings
Go to GitHub Settings → Pages → Add a domain, then paste the _github-pages-challenge TXT record into Namecheap Advanced DNS.
- Delete Namecheap default parking records
Remove parkingpage.namecheap.com CNAME and default URL Redirect so Let’s Encrypt sees only GitHub IPs.
- Commit a CNAME file to your repo root and check Enforce HTTPS
Enter your custom domain under Repo → Settings → Pages and check "Enforce HTTPS" once DNS check passes (~10 minutes).
Recommended Verified Offer for This Setup
Get a .COM Domain for Just $5.98 + Free Lifetime WHOIS Privacy
Register your first .COM domain at Namecheap for $5.98 (up to 60% off standard retail) with free Domain Privacy protection forever and free DNSSEC.
Frequently Asked Questions
Why is the "Enforce HTTPS" checkbox greyed out on GitHub Pages?
99% of the time a leftover Namecheap URL Redirect record or AAAA record is blocking Let’s Encrypt validation. Remove old records, save your custom domain again in GitHub Pages settings, and wait 10 minutes.