Quick answer
How do I connect a domain to GitHub Pages?
To connect a domain to GitHub Pages, point the bare domain to GitHub's 4 A records (185.199.108.153 to 185.199.111.153) and www to your user.github.io name, then enter the domain in the repository's Pages settings. DotAlmanac's GitHub Pages template prepares all 9 records at once, as of 29 October 2026.
GitHub Pages DNS at a glance
| A records (@) | 185.199.108.153 · 185.199.109.153 · 185.199.110.153 · 185.199.111.153 |
|---|---|
| AAAA records (@) | 2606:50c0:8000::153 · 2606:50c0:8001::153 · 2606:50c0:8002::153 · 2606:50c0:8003::153 |
| www | CNAME to USERNAME.github.io, without the repository name |
| Where to enter the domain | Repository › Settings › Pages › Custom domain |
| Domain verification | TXT record _github-pages-challenge-USERNAME, from your profile Settings › Pages |
| HTTPS | "Enforce HTTPS" in the Pages settings, once GitHub has issued the certificate |
| TTL of the template records | 3600 seconds (1 hour) |
| DNS hosting | Free with every DotAlmanac domain |
What do I need before I connect a domain to GitHub Pages?
DotAlmanac is a domain extension guide and registrar: compare every extension, then register it with no KYC and pay in crypto. To follow this guide, you need three things.
- A domain on DotAlmanac's nameservers. The Nameservers tab of the domain must read "Our nameservers". If the domain uses other nameservers, add the same records at that DNS provider.
- A repository with GitHub Pages turned on. It can publish from a branch or from a GitHub Actions workflow.
- Your GitHub user or organization name. It goes in the www record. The repository name never does.
Many developers pick .dev or .app for a project site. Check the renewal first: according to DotAlmanac's price grid, .dev renews 44% above its first-year price and .app 67% above, as of 29 October 2026. A .dev costs $8.99/year, then $12.99/year. Both extensions need HTTPS, which GitHub Pages provides. Compare them on .app vs .dev.
How to connect your domain to GitHub Pages in 6 steps
Verify the domain on GitHub first
In your GitHub profile, open Settings › Pages › Add a domain. GitHub shows a TXT record named
_github-pages-challenge-USERNAMEand a value. Add it in the domain's DNS tab, then press Verify.Open the GitHub Pages template
In the client area, open the domain, then DNS › Templates › GitHub Pages. Enter your GitHub user or organization name, for example
octocat.Review the preview, then save
The preview lists 4 A, 4 AAAA and 1 CNAME record. It replaces the A, AAAA, CNAME and ALIAS records of @ and www, and leaves MX and TXT records alone. Nothing is sent before you save.
Enter the custom domain in the repository
In the repository, open Settings › Pages › Custom domain, type the domain and press Save. Publishing from a branch adds a
CNAMEfile to it; a GitHub Actions workflow needs no such file.Wait for GitHub's DNS check
GitHub checks the records and shows the result under Custom domain. The wait depends on the TTL of any records that resolvers cached before your change.
Turn on Enforce HTTPS
Once GitHub has issued the certificate, tick Enforce HTTPS in the same Pages settings. For .dev and .app, the site does not load until HTTPS works.
What are the exact DNS records for GitHub Pages?
These are the values GitHub publishes for apex domains and for www. The DotAlmanac template adds exactly these 9 records.
| Type | Name | Value | TTL |
|---|---|---|---|
| A | @ | 185.199.108.153 | 3600 |
| A | @ | 185.199.109.153 | 3600 |
| A | @ | 185.199.110.153 | 3600 |
| A | @ | 185.199.111.153 | 3600 |
| AAAA | @ | 2606:50c0:8000::153 | 3600 |
| AAAA | @ | 2606:50c0:8001::153 | 3600 |
| AAAA | @ | 2606:50c0:8002::153 | 3600 |
| AAAA | @ | 2606:50c0:8003::153 | 3600 |
| CNAME | www | USERNAME.github.io | 3600 |
Replace USERNAME with your GitHub user or organization name. GitHub's documentation and the Pages settings of your repository are the reference: if GitHub shows other values for your site, use those.
Can I paste the records as a zone file instead?
Yes. Open DNS › Import / export › Import zone file, choose "Add to existing records" and paste the lines below. Replace octocat with your own user name. The import reads standard BIND syntax, shows a preview and sends nothing before you save.
@ 3600 IN A 185.199.108.153
@ 3600 IN A 185.199.109.153
@ 3600 IN A 185.199.110.153
@ 3600 IN A 185.199.111.153
@ 3600 IN AAAA 2606:50c0:8000::153
@ 3600 IN AAAA 2606:50c0:8001::153
@ 3600 IN AAAA 2606:50c0:8002::153
@ 3600 IN AAAA 2606:50c0:8003::153
www 3600 IN CNAME octocat.github.io.Should I use the bare domain or www with GitHub Pages?
Set up both, and enter the one you prefer in the repository. When the records of the apex and of www are correct, GitHub Pages redirects the other one to it.
GitHub supports one apex domain or one www name per site. It does not support two apex domains, two www names, or an apex combined with another custom subdomain. For a project on a subdomain, such as docs.example.com, add one CNAME from docs to USERNAME.github.io and skip the A records.
How long until my domain works on GitHub Pages?
It depends on the TTL of the records that resolvers saw before your change. TTL is the number of seconds a resolver keeps an answer in its cache.
- A name with no earlier record resolves as soon as you save.
- A replaced record keeps its old value in some caches until its old TTL runs out. The template records use 3600 seconds, which is one hour.
- Plan a move ahead: lower the TTL of the old records to 300 seconds a day before the change.
GitHub's own documentation says DNS changes can take up to 24 hours to propagate. The HTTPS certificate comes after the DNS check succeeds.
Why does GitHub say my domain is not properly configured?
In most cases, an old record still answers for the same name. Check these points in order:
- Leftover records. An old A, AAAA or ALIAS record at @, or a parking record, competes with GitHub's. The template removes them; manual edits often miss one.
- Repository name in the CNAME. The www target is
USERNAME.github.ioonly. - Wildcard record. GitHub warns that a record such as
*.example.comcreates a risk of domain takeover. Delete it. - Other nameservers. If the domain uses another DNS provider, the records in DotAlmanac's DNS tab are not served.
- CAA records. If you publish CAA records, GitHub requires at least one with the value
letsencrypt.orgfor HTTPS.
Test the result with dig example.com +short or any online DNS lookup.
GitHub Pages and custom domains: FAQ
Do I need all 4 A records for GitHub Pages?
Yes. GitHub publishes 4 addresses for redundancy, and the template adds all of them. GitHub also recommends the 4 AAAA records for visitors on IPv6, alongside the A records.
Why verify the domain before adding it to the repository?
Verification stops other GitHub users from claiming your domain for their own Pages site. Without it, a deleted repository or a turned-off Pages site can leave the domain open to takeover. Verify first, then add the domain to the repository.
Can I keep my email when I point the domain to GitHub Pages?
Yes. The GitHub Pages template changes only the A, AAAA, CNAME and ALIAS records of @ and www. Your MX, SPF and other TXT records stay as they are.
Is DNS hosting for GitHub Pages extra at DotAlmanac?
No. DNS hosting, the templates and the zone file import are free with every domain. You pay only the domain, for example $11.99/year for a .com, as listed on the pricing page.
Which extension suits a GitHub Pages project site?
Any extension works with GitHub Pages. Developers often choose .dev, .io or .com; compare them on best domain extension for developers. Check the renewal price as well as the first-year price.
Sources (3)
- Managing a custom domain for your GitHub Pages site — GitHub Docs (checked 2026-10-29)
- Verifying your custom domain for GitHub Pages — GitHub Docs (checked 2026-10-29)
- Troubleshooting custom domains and GitHub Pages — GitHub Docs (checked 2026-10-29)
Need a domain for your GitHub Pages site?
Register it with no KYC, pay in crypto, and apply the GitHub Pages template from the DNS tab.