Connect a .ch domain to GitHub Pages

Set the custom domain in the repository before adding GitHub’s published DNS records.

Last updated:

Configure the repository

  1. Open the repository’s Settings, then Pages, and enter the custom .ch domain.
  2. Choose whether the root or www hostname is primary and keep GitHub’s current DNS documentation open.
  3. For an organisation or project site, confirm that the repository and Pages source are the intended ones.

Configure and verify DNS

  1. For www, add the CNAME target GitHub specifies. For an apex domain, add GitHub’s currently published A and, if desired, AAAA records.
  2. Remove conflicting records for the same hostname, but leave email records intact.
  3. Complete GitHub’s DNS check. Enable Enforce HTTPS only after the certificate is ready.

Verify the domain in your GitHub organisation or account to reduce takeover risk.

Frequently asked questions

Should I put a repository URL in a CNAME record?

No. Use the hostname GitHub provides, not an https URL, path or repository address.