NOTE: This tutorial assumes you have a GitHub page already created.
If this is not your case please follow https://guides.github.com/features/pages/
Github configuration
Go to ‘https://github.com/<GITHUB_USERNAME>/<YOUR_GITHUB_REPO>/settings’
Scroll down until you reach GitHub Pages section and add your domain/subdomain there.
Click on Save and you are good to go. Github will create a new CNAME file with the specified custom domain as its content in your repository.
IONOS configuration
Login into your IONOS account and select the domain you want to use for your Github Page https://my.ionos.com/domains
Then go to your domain DNS configuration panel:
You need to delete all existing «A» and «AAAA» records for the «@» host and replace them with the IP addresses for GitHub Pages «A» records.
185.199.108.153 185.199.109.153 185.199.110.153 185.199.111.153
NOTE: Please verify if the IPs haven’t changed: https://help.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site#configuring-an-apex-domain
After they are all deleted, you need to click on Add registry to create the new A records pointing to the Github Pages IPs.
- Type: A
- Hostname: @
- Points to: 185.199.109.153
- TTL: 1 hour (default value)
- Add a DNS registry for www: disabled
NOTE: It’s VERY important that «Add a DNS registry for www» option is disabled (see picture below)
After creating the new 4 «A» records you need to add a new one. This time a «CNAME» record pointing to your <GITHUB_USERNAME>.github.io
- Type: CNAME
- Hostname: www
- Points to: <GITHUB_USERNAME>.github.io.
- TTL: 1 hour (default value)
After all the steps this is how your IONOS domain DNS configuration should look like:
Annnd that’s all, give the new DNS configuration a few minutes so it can be propagated and your Github Page should be accessible via your IONOS domain 🙂