The whole process for various situations is described in GitHub documentation. This is just a reminder for myself how to properly configure top-level apex domain redirect with GitHub Pages.
All of your
<orgname>.github.io pages will be
redirected to the new custom domain, so your project pages can benefit from this
automatically. If you already have a project page like
<username>.github.io/projectname, this will become
Sequence of actions
Let’s say you own
domain.com for the sake of example, and your github username
Create a repository with name
<orgname>.github.io depending on the repo type.
Create a repo
yourname.github.io add a file called
CNAME with the following
contents to the root directory:
If you prefer the name with www prefix, put it at the top. Commit and push. That’s it with github.
At DNS provider config
Add an A record:
name: @ type: A TTL : 1h data: [188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168]
Add a CNAME record:
name: www type: CNAME TTL : 1h data: yourname.github.io
With domains.google.com this looks like the following:
It might take several hours for the information to propagate throughout the net and become accessible everywhere.