Are you struggling to get your blog running on a custom domain that you already own within Google Domains? Confused with
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.
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?
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 (
https) as the underlying logic will make sure to concatenate a required protocol to your domain as needed.
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.
If you are going to set up an
A record. Use hashnode's IP (18.104.22.168) server address as the value. IP addresses can change frequently, so make sure to check out the aforementioned documentation for the exact IP value.
I would suggest, going with what is recommended and adding a
CNAME if you are in the same condition as me.
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.
- For validating DNS records propagation in my zone used www.whatsmydns.net.
Once achieved, go to the "Domain" section in your blog's dashboard and you should see and feel good as your blog is alive.
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.
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!