Point the root domain at GitHub’s four addresses — with the four IPv6 ones if you like — and www at your github.io name. Then add the domain in the repository’s Pages settings and wait for GitHub’s Let’s Encrypt certificate. Verify the domain too: it stops anyone else’s repository from taking it over.
The records to add
| Name | Type | Value |
|---|---|---|
@ | A | 185.199.108.153 |
@ | A | 185.199.109.153 |
@ | A | 185.199.110.153 |
@ | A | 185.199.111.153 |
@ | AAAA | 2606:50c0:8000::153 |
@ | AAAA | 2606:50c0:8001::153 |
@ | AAAA | 2606:50c0:8002::153 |
@ | AAAA | 2606:50c0:8003::153 |
www | CNAME | USERNAME.github.io |
The AAAA records are optional; if you add them, keep the A records too. Point www at your user or organisation name on github.io — never at the repository name or the site’s *.pages.github.io address. Instead of the A records, an ALIAS or ANAME to USERNAME.github.io also works.
| Verification | TXT at _github-pages-challenge-USERNAME, from the account’s Pages settings |
| Certificate | Let’s Encrypt, usually within an hour |
Check your domain
Enter your domain: we look up its records and compare them with what GitHub Pages expects — the root, www, and any record left over from before.
Step by step
- In the repository, open Settings → Pages and enter the custom domain; GitHub commits a CNAME file.
- At your DNS host, add the four A records (and the AAAA records if you want IPv6) for the root, and a CNAME for www to USERNAME.github.io.
- Verify the domain in your account’s (or organisation’s) Pages settings with the TXT record GitHub gives you.
- When the certificate is ready, tick Enforce HTTPS.
What to remove
- Any default record your DNS host set for the root — a parking page, forwarding.
- Any other A, AAAA, ALIAS or ANAME records on the root: GitHub says they can stop the certificate being issued.
The certificate
GitHub gets a Let’s Encrypt certificate once the records resolve — usually within an hour; Enforce HTTPS can take up to 24 hours to become available. If the domain has CAA records, one must allow letsencrypt.org.
Common mistakes
- A wildcard DNS record (*.example.com) pointing at GitHub: GitHub warns it puts the domain at immediate risk of takeover, even when verified.
- Leaving the custom domain set on a disabled or deleted site — another user can then claim it.
- Pointing www at the repository name, or at the site’s pages.github.io address.
- After changing DNS, the Pages settings may need the domain removed and added again.
Sources
Records checked on 26 September 2026 against these official sources:
- Managing a custom domain for your GitHub Pages site — docs.github.com
- Verifying your custom domain for GitHub Pages — docs.github.com
- Securing your GitHub Pages site with HTTPS — docs.github.com