I recently joined Hasnode. One of the primary reasons was the ability to map a custom domain, and that too free of charge. In this blog post, I will share the steps to set up a custom domain using Namecheap and Hashnode.
Buy your domain name
I compared domain name prices across different providers and found the best deal at Namecheap.com. It's a good idea to check out all the major providers as costs can vary widely.
Set up the DNS
Once you have your domain name, you need to configure the DNS settings. On the Namecheap dashboard, click 'Manage' for the domain name you want to connect.
Under the 'Domain' tab, set Nameservers to 'Namecheap BasicDNS'.
Under the 'Advanced DNS' tab, add the following 'Host Records'
A Record: This tells the DNS which IP address to hit when a request for your domain is made. This IP address is the entry point to the Hashnode network. Once the request reaches their network, their internal redirection logic will take care of serving the home page corresponding to your blog.
CNAME Record: This is to redirect requests for www.devwise.in to devwise.in.
Map the custom domain in Hashnode
The final step is to map your custom domain in your Hashnode blog dashboard under the 'Domain' setting. When a request for our domain reaches the Hashnode servers, they will know which blog to return as the response.
Note: DNS changes can take a couple of hours to propagate worldwide. You can check the propagation using services like this one.
What about SSL?
Another benefit of using Hashnode is that they provide auto-provisioning of SSL on custom domains through Let's Encrypt. Saves both cost and effort.
A Record: A stands for Address. For a given domain, this entry indicates the IP address of the computer connected to the Internet. This computer can be a single server instance deployed on a single computer, or it can be a gateway to a complex server system. In our case, the IP address points to the Hashnode network.
CNAME Record: Canonical Name maps one domain name to another. In our case, if a request to www.devwise.in is made, the request will be forwarded to hashnode.network. That will redirect the request (with a
HTTP Response Code 307) to devwise.in, which will then hit Hashnode servers again, through
A Recordsetting, and get my blog's homepage.
The setup was easy and my blog was up and running in 10 mins. That's great as a product offering. However, the software engineer in me wanted to know more. So, my next article is on important DNS concepts that every developer should know.