Point custom subdomain and root domain to GitHub Pages

Introduction

I followed the steps below to point my root domain zean.be and the custom subdomain www.zean.be to a GitHub Pages project.

Steps

Step 1: configure your GitHub Pages project to accept requests from your custom domains.

Create a file called CNAME in the root directory with the following two entries (with zean.be replaced by your own domain),

CNAME
zean.be
www.zean.be

These two entries tell GitHub to redirect any requests to USERNAME.github.io to the domain specified in the CNAME file.

There are two entries to ensure that www.zean.be will also redirect to zean.be.

Step 2: add DNS records to point your root domain/subdomain to GitHub.

Add the following CNAME record to your DNS provider,

www.zean.be    CNAME    USERNAME.github.io

and add the following A records for the root domain,

@    A    185.199.108.153
@    A    185.199.109.153
@    A    185.199.110.153
@    A    185.199.111.153

References