Setting Up a Custom Google Domain on your Github Pages website

Purchase and Setup a Google Domain

First, you need to purchase a domain on Google domains - which will likely cost you about $12 a year.

Once ready, navigate to the DNS section and setup the following custom resources records:

An image

This likely won't work on the first attempt, so go get a coffee refill as propagation of DNS records can take a few seconds to a few hours.

Great, you got more coffee! Now try running the following command in terminal to verify everything is now working:

dig +noall +answer tips4devs.com
1

When the DNS changes are ready, it should ouptup the following:

An image

Create a Github Repo and Setup Public Pages

Now create a new github project if you haven't already. Then navigate to your repository settings page, under Settings / Options and scroll down to GitHub Pages section.

An image

Set your custom domain and press Save It should validate the setup.

At this point you should be able to check the Enforce HTTPS option.

¡And Voilà!

For more detailed info, follow the official github doc

Join The Conversation