GitHub Pages lets you host a static website for free directly from a GitHub repository. You can use a custom domain — for example, pointing yourdomain.com at a GitHub Pages site — by adding a few DNS records.

Good to know: your domain stays with CanSpace (registration, DNS management) — only the website files are hosted at GitHub. You can move back to CanSpace hosting at any time by changing the DNS records.

Records you need to add

GitHub Pages uses four IP addresses. To point a root (apex) domain like yourdomain.com at GitHub, add four A records:

Type Name / Host Value TTL
A@ (or leave blank)185.199.108.15314400 (default)
A@ (or leave blank)185.199.109.15314400
A@ (or leave blank)185.199.110.15314400
A@ (or leave blank)185.199.111.15314400

And for the www version of the domain:

Type Name / Host Value TTL
CNAMEwww<your-github-username>.github.io14400

Replace <your-github-username> with your actual GitHub username (or the organization name that owns the repository).

Where to add the records

Where you add these depends on whether you have CanSpace hosting or a domain-only registration:

  • Domain-only (no CanSpace hosting) — use the DNS Manager in the client area. Domains → My Domains → Manage → Manage DNS Records. See How do I manage DNS entries? for the walkthrough.
  • Domain + hosting on CanSpace — use the Zone Editor in cPanel (Domains section). If you want your website files to come from GitHub instead of your CanSpace hosting, you'll remove or update the default A records that point your domain at the hosting server and replace them with GitHub's IPs.
Heads up if you're also running email on CanSpace: don't remove the MX records when switching A records to GitHub. Your website goes to GitHub, but email stays with CanSpace as long as the MX records remain.

At the GitHub side

In your repository's settings on GitHub:

  1. Go to Settings → Pages.
  2. Under Custom domain, enter your domain (e.g. yourdomain.com) and click Save.
  3. GitHub will verify that the DNS records are pointing correctly — you'll see a green check once it's confirmed.
  4. Tick the Enforce HTTPS box once the certificate is provisioned (usually within an hour of DNS validation).

Waiting for propagation

DNS changes propagate gradually. Most visitors will see the GitHub version within 15 minutes to a few hours, though full propagation can take up to 24-48 hours. You can check whether propagation is done using a tool like dnschecker.org — enter your domain and look for the 185.199.* IPs.

Subdomain (e.g. docs.yourdomain.com)

If you only want a subdomain pointed at GitHub Pages (instead of the root domain), skip the A records and just add a CNAME:

Type Name / Host Value
CNAMEdocs (or whatever subdomain)<your-github-username>.github.io

Related articles

Having trouble getting GitHub Pages to recognize your custom domain? Open a support ticket

Помог ли вам данный ответ? 341 Пользователи нашли это полезным (1172 голосов)