Custom Domain and HTTPS¶
Use this checklist when you are ready to move from the default GitHub Pages URL to your own domain.
Repo changes¶
- Set the production URL in
mkdocs.yml:
- Set the domain in
CNAME:
- Commit and push those changes.
GitHub Pages settings¶
- Open the repo on GitHub.
- Go to Settings → Pages.
- Confirm the site is being served from the correct branch.
- Enter the custom domain if needed.
- If you are publishing from a branch, GitHub can create or update the
CNAMEfile for you when you save the custom domain.
DNS patterns¶
Apex/root domain¶
Use one of these with your DNS provider:
ALIASorANAMEpointing atyourname.github.io- or
Arecords pointing at the GitHub Pages IPv4 endpoints - optional
AAAArecords for IPv6 support
Subdomain¶
Use a CNAME pointing to:
Domain verification (recommended)¶
Verification happens at the profile or account level, not the repository level.
- In GitHub, open your profile settings.
- Go to Pages.
- Start domain verification for
yourdomain.com. - Add the TXT record(s) GitHub gives you at your DNS provider.
- Wait for DNS propagation and complete verification.
HTTPS checklist¶
- Wait for DNS to propagate.
- Wait for GitHub Pages certificate provisioning.
- In Settings → Pages, enable Enforce HTTPS when it becomes available.
- Test both:
https://yourdomain.comhttps://www.yourdomain.comif you usewww
Troubleshooting¶
- mismatch between
CNAMEand GitHub Pages settings - DNS still propagating
- wrong record type for apex vs subdomain
- certificate not provisioned yet
- wildcard DNS records can create takeover risk and are best avoided