If you host your site on GitHub Pages, you can still use your own custom domain by updating your GitHub Pages settings and adding the correct DNS records in your purely.website account.
Add your custom domain in GitHub Pages
- Open your site’s repository in GitHub.
- Go to Settings, Pages.
- In the Custom domain box, enter your domain (e.g. www.example.co.uk).
- Click Save.
GitHub will create a file named CNAME in your publishing branch. This file must remain in place for your custom domain to work.
Set up DNS records in purely.website
First ensure your DNS zone is setup, then you can add the following A Records,
For root domains (e.g. example.co.uk):
Create A records pointing to GitHub Pages IP addresses:
Type | Host | Value |
---|---|---|
A | @ | 185.199.108.153 |
A | @ | 185.199.109.153 |
A | @ | 185.199.110.153 |
A | @ | 185.199.111.153 |
For subdomains (e.g. www.example.github.io):
Create a CNAME record pointing to your GitHub Pages default domain (USERNAME.github.io), without including your repository name. For example:
Type | Host | Value |
---|---|---|
CNAME | www | username.github.io |
Enable HTTPS
Once DNS has propagated (can take up to 24 hours), go back to Settings → Pages in GitHub.
Tick Enforce HTTPS.
Your site will now load securely over https://.
Troubleshooting
Domain still points to the GitHub.io address, Check that your DNS changes have saved and that the CNAME file exists in your branch.
HTTPS option not appearing, Wait up to 24 hours; GitHub needs to issue an SSL certificate after confirming your DNS.
If the root domain not loading, Ensure all four A records are present.