Set your custom blog domain with Google Domains and Hashnode

Set your custom blog domain with Google Domains and Hashnode

A supplementary document for bodies trying to get their blog operating under a custom domain under the management of Google Domains.

Are you struggling to get your blog running on a custom domain that you already own within Google Domains? Confused with CNAME and A records? So was I.

Documentation for setting up a custom domain on hashnode is well, good. But as we sometimes rush through doing things, we can make assumptions or mistakes.

This post will:

- give an example to supplement documentation resources.
- provide additional resources for validation and understanding of involved processes.
- help you avoid configuration mistakes that I made.

I will embed this example in the context of activating the same for my blog - blog.katolus.dev.

Your case might be different, but hopefully, this will still help you.

Requirements

Following assumes that you can answer yes to all of these questions:

  • Do you own a domain in Google Domains and have access to the DNS section?
  • Do I have an account on hashnode?

Process

You can either set up the custom domain as part of the account installation or as an after step in a blog's dashboard. The documentation will walk you through the process easy-peasy. There are however a few points that I would suggest looking out for.

Just the domain

⚠️ When entering a domain name, omit the protocol prefix (http/https) as the underlying logic will make sure to concatenate a required protocol to your domain as needed.

Good - blog.katolus.dev

Bad - https://blog.katolus.dev

DNS record

Whichever way you end up here, the crucial point comes when you need to set up a record that points from your domain to the place where your blog is being served.

You can either set up a CNAME or an A type record. They are different, so if you like to know more, check the link.

Before you save, it is a good idea to set the TTL value low enough so that you don't have to wait for a whole day to see any changes.

If you are going to set up a CNAME record. Use hashnode's network domain (hashnode.network). Review documentation to get the latest domain name.

flameshoot_2021-10-19-12-28-57.png

If you are going to set up an A record. Use hashnode's IP (76.76.21.21) server address as the value. IP addresses can change frequently, so make sure to check out the aforementioned documentation for the exact IP value.

flameshoot_2021-10-19-14-39-28.png

I would suggest, going with what is recommended and adding a CNAME if you are in the same condition as me.

Validation

Here are options of tools I used in troubleshooting and validating settings along the way.

  • For validating the domain's DNS records details I used www.who.is.

image.png

image.png

Expectations

Once achieved, go to the "Domain" section in your blog's dashboard and you should see and feel good as your blog is alive. image.png

Make it Clean

After the beans have been cooked and you have successfully linked the domain to your blog, a good practice is to change the TTL value to something reasonably higher so that whichever cache is involved it doesn't have to do a DNS record validations too often.

flameshoot_2021-10-19-14-51-20.png

Environmental conditions

I hosted the blog under a subdomain of an existing website, hosted on a completely different service.

My SSL certificate is being managed within Google Domains.

Did you find this article valuable?

Support Piotr Katolik by becoming a sponsor. Any amount is appreciated!