Publishing docs — all chapters

How Selfish helps

When a site publishes to GitHub Pages, Netlify or Cloudflare Pages, and its Site URL is a domain of your own, Site Settings → Publishing gains a section called Your Own Domain. It shows:

  1. The steps to take at the host, in order.
  2. The exact DNS records your domain needs.
  3. A Check button that looks the domain up and says where it points now.

The check answers one of three ways: the domain points at your host, it points somewhere else for now, or it doesn’t lead anywhere yet.

The check uses your device’s own resolver. Your domain isn’t sent to a lookup service, or to us.

New records can take from a few minutes to a day to reach everyone, so a check that fails straight after you add them isn’t a mistake. Try again later.

Two kinds of address

The records differ depending on which you are setting up.

In the tables below, the name @ means the domain itself.

GitHub Pages

For the domain itself:

TypeNameValue
A@185.199.108.153
A@185.199.109.153
A@185.199.110.153
A@185.199.111.153
AAAA@2606:50c0:8000::153
AAAA@2606:50c0:8001::153
AAAA@2606:50c0:8002::153
AAAA@2606:50c0:8003::153
CNAMEwww<owner>.github.io

For a subdomain, one record: a CNAME from the subdomain to <owner>.github.io. The target is your GitHub user or organisation name. It never includes the repository’s name.

Then:

  1. Add the records at your domain’s DNS.
  2. In the repository’s Settings → Pages, enter the domain as the custom domain.
  3. Once GitHub has issued the certificate, tick Enforce HTTPS.

GitHub remembers the domain in a file called CNAME on the branch. Selfish keeps that file on every publish, so the domain is never reset.

Netlify

For the domain itself:

TypeNameValue
A@75.2.60.5
CNAMEwww<your-site>.netlify.app

For a subdomain, one record: a CNAME from the subdomain to <your-site>.netlify.app.

Then:

  1. In Netlify, open the site’s Domain management and add the domain.
  2. Add the records at your domain’s DNS.
  3. Netlify issues the certificate itself once the records are in place.

If your DNS provider offers ALIAS, ANAME or flattened CNAME records for a domain itself, Netlify’s own documentation prefers one of those, pointing at apex-loadbalancer.netlify.com, over the A record. Either works.

Cloudflare Pages

For a subdomain, one record: a CNAME from the subdomain to <project>.pages.dev.

  1. In the Pages project, open Custom domains and set the domain up there first. Without that step the record alone shows an error.
  2. Add the record at your domain’s DNS. If the domain is on Cloudflare, Cloudflare adds it for you.

For the domain itself, its DNS has to be on Cloudflare. Set the domain up under Custom domains in the Pages project and Cloudflare adds the record.

Other routes

On your own server, on S3-compatible storage, over WebDAV or with a folder, the records depend on your host, so Selfish doesn’t guess them. Your host or CDN will tell you what to point the domain at. Set Site URL to the finished address and publish again.

After the domain works

Set Site URL in Site Settings → Site to the new address and publish again. Your feeds, sitemap, canonical links and link previews are all built from it, so they follow the domain.