GitHub Pages - Custom Domain19 Jun 2018
- register root domain
- add custom blog domain in repo settings on GitHub
- update nameservers used by your domain registrar
- add CNAME record for custom blog domain
- check custom blog domain is set up correctly
- [OPTIONAL] use root domain as a custom blog 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, example.com)
ADNS records are for IPv4 only
AAAADNS records are for IPv6 only
You can set up a custom subdomain, such as blog.example.com, by creating a CNAME record through your DNS provider.
register root domain
I want to use subdomain
blog.tap349.com of my root domain
tap349.com as a
custom domain for my blog on GitHub Pages (http://tap349.github.io) - 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.
IS AN ALIAS OF:
check custom blog domain is set up correctly
$ dig blog.tap349.com +nostats +nocomments +nocmd ; <<>> DiG 9.10.6 <<>> blog.tap349.com +nostats +nocomments +nocmd ;; global options: +cmd ;blog.tap349.com. IN A blog.tap349.com. 43200 IN CNAME tap349.github.io. tap349.github.io. 3600 IN CNAME sni.github.map.fastly.net. ...
[OPTIONAL] use root domain as a custom blog domain
NOTE: you cannot have multiple custom blog domains.