What is GitHub Pages CNAME Helper?
A CNAME file tells GitHub Pages which custom domain should be attached to a published site. The file must contain only the domain name, with no protocol, path, or extra text. This helper keeps the file content and DNS notes separate, which helps prevent small publishing mistakes.
quickAnswer
Create the CNAME file for a GitHub Pages custom domain and get the matching DNS guidance for www or apex setups. The file must contain only the bare domain name with no protocol or path.
Last updated: 2026-06-11
limitations
- The CNAME file must exist in the published site root, typically inside your dist or build output folder. If your build tool regenerates the output folder, the CNAME file must be re-added each time.
- DNS propagation after updating CNAME or A records can take minutes to 48 hours depending on your domain provider and TTL settings.
- Apex domain setup requires A records pointing to GitHub Pages IP addresses, not a CNAME record. CNAME records at the apex are not allowed by DNS standards for most providers.
Sources:MDN Web Docs · W3C Specifications · jquery.app on GitHub
How to use this tool
- Enter the custom domain you want to use for GitHub Pages.
- Choose whether the site will use a www subdomain or an apex domain.
- Copy the CNAME file content into a file named CNAME at the published site root.
- Apply the DNS notes at your domain provider, then enable HTTPS in GitHub Pages settings.
What you can use it for
- Create the CNAME file for a custom GitHub Pages domain.
- Check whether a www or apex domain setup needs different DNS records.
- Document DNS changes before updating a domain provider.