ShareYourGroupShareYourGroupDNS and Domain Tools

Custom domain for GitHub Pages: the DNS records

A site on GitHub Pages needs one thing from your DNS provider: records that point the domain at GitHub.

For a subdomain such as blog.example.com

Create one CNAME record for the subdomain that points to the default address of your site, which is username.github.io (or the name of your organization). You can check it with the DNS lookup tool: for example, we looked up raimayank7.github.io and got the four addresses below.

For an apex domain such as example.com

GitHub's documentation says to create an ALIAS, ANAME or A record. For A records, point the apex to these four addresses, and for IPv6 add four AAAA records:

A recordsAAAA records
185.199.108.1532606:50c0:8000::153
185.199.109.1532606:50c0:8001::153
185.199.110.1532606:50c0:8002::153
185.199.111.1532606:50c0:8003::153

These are the values printed in GitHub's documentation on 14 November 2026. Check that page for changes before you copy them, because providers can change addresses.

Also set up www

GitHub recommends setting up a www subdomain next to an apex domain. With the records right for both, GitHub Pages creates the redirects between them itself.

Then in the repository

Add the custom domain in the repository's Pages settings. If you publish from a branch, GitHub creates a CNAME file in the root of the source branch. If you publish from an Actions workflow, no CNAME file is made and an existing one is ignored. The option "Enforce HTTPS" can take up to 24 hours to become available.

Warnings from the documentation

Check it

  1. Look the name up with the DNS lookup tool: a subdomain should show a CNAME to username.github.io, an apex domain the four A records.
  2. Look at the TTL, and wait that long after a change.
  3. Check your domain's registration and name servers in the domain lookup tool, to be sure you edit the right DNS zone.
Can I use a CNAME on the apex domain?

Not with plain DNS. Use A records, or an ALIAS or ANAME record if your provider has one.

The certificate is not ready. What now?

Wait, as the documentation says it can take up to 24 hours, and check the records again.

Sources

  • GitHub Docs: Managing a custom domain for your GitHub Pages site (docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site)
  • RFC 1035, CNAME and NS records

Read on 14 November 2026.

This is an independent guide. It is not connected with Cloudflare, Google, ICANN, IANA, GitHub or any registry named here. Facts were read on 14 November 2026 from the documents named on each page. Lookups are made from your browser to the services named in the result.