GitHub Pages Tools

GitHub Pages CNAME Helper

Enter a domain and get the exact CNAME file content plus common DNS record guidance for apex and www setups.

Loading tool...

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 is for beginners who want to avoid small formatting mistakes before pushing a site to GitHub.

How to use this tool

  1. Enter the custom domain you want to use for GitHub Pages.
  2. Choose whether the site will use a www subdomain or an apex domain.
  3. Copy the CNAME file content into a file named CNAME at the published site root.
  4. 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.

Use cases

Practical examples

Example

www custom domain

A site owner wants www.example.com to load a GitHub Pages site. The tool outputs the CNAME file content and reminds them to point the www record at the GitHub Pages host.

Example

Apex domain planning

A beginner wants example.com without www. The tool separates the CNAME file content from the DNS note so they do not paste the wrong value into the wrong place.

Common mistakes

  • Putting https:// in the CNAME file.
  • Adding a path after the domain name.
  • Mixing apex A records with an unrelated CNAME record.

FAQ

Questions about GitHub Pages CNAME Helper

Should the CNAME file include https://?

No. The CNAME file should contain only the domain name, such as www.example.com.

Where should the CNAME file be placed?

Place it at the root of the published site. If you deploy a dist folder, the CNAME file must exist inside that published output.

Why does my custom domain disappear after deployment?

Many build tools delete and regenerate the output folder. Make sure the CNAME file is copied into the final build output every time.