GitHub Pages - Custom Domain

DNS provider
company providing DNS servers (nameservers) - it might be your domain registrar or entirely different company (say, DigitalOcean)
root domain
= apex domain (say,


You can set up a custom subdomain, such as, by creating a CNAME record through your DNS provider.

register root domain

I want to use subdomain of my root domain as a custom domain for my blog on GitHub Pages ( - I will refer to it as a custom blog domain hereafter to avoid ambiguity.

add custom blog domain in repo settings on GitHub


this will create CNAME file with a custom blog domain in the root of blog repo (in a separate commit):

update nameservers used by your domain registrar


To use DigitalOcean DNS, you’ll need to update the nameservers used by your domain registrar to DigitalOcean’s nameservers instead.

enter DigitalOcean nameservers in DNS settings of your domain registrar (it might be necessary to select your root domain first):

It will take some time for the name server changes to propagate after you’ve saved them. During this time, the domain registrar communicates the changes you’ve made with your ISP (Internet Service Provider). In turn, your ISP caches the new nameservers to ensure quick site connections. This process usually takes about 30 minutes, but could take up to a few hours depending on your registrar and your ISP’s communication methods.

add CNAME record for custom blog domain


CNAME record must be created through your current DNS provider.

Create ▼ (top right menu) → Domains/DNS

this will make DNS lookups for to redirect to

at the same time if you open in browser it will substitute URL for

check custom blog domain is set up correctly

$ dig +nostats +nocomments +nocmd
; <<>> DiG 9.10.6 <<>> +nostats +nocomments +nocmd
;; global options: +cmd
;		IN	A	43200	IN	CNAME	3600	IN	CNAME

[OPTIONAL] use root domain as a custom blog domain


NOTE: you cannot have multiple custom blog domains.