When you create your Hashnode blog, we provide you with a free subdomain that looks like "yourdomain.hashnode.dev". However, you can set up your own domain for your Hashnode blog, such as "yourdomain.tld", or a subdomain, such as "blog.yourdomain.tld".
In this guide, you will learn the steps to accomplish this alongside some additional specific guides for different domain DNS providers.
1. From the home page, navigate to the dashboard of the blog where you want to change the subdomain.
2. Navigate to the Domain tab from the dashboard sidebar, where you find Custom Domain tab to change the custom domain. The custom domain could be an apex domain (yourdomain.tld) or a subdomain (blog.yourdomain.tld).
3. From the popup, select if you want to use the "www" and redirect it to the "non-www" version (apex domain) or not.
We recommend setting up your custom domain with the “www” as the subdomain which redirect to your apex domain.
4. Map the Hashnode DNS record to your DNS provider.
-
Add an "A record" for your apex domain at the root whose hostname is "@" with a value of "76.76.21.21".
-
Add a CNAME record for the hostname www and the corresponding value is "hashnode.network". This CNAME record will point your domain or subdomain to Hashnode's IP address.
Using the CNAME record at the root level (e.g., yourdomain.tld) is not recommended unless your DNS provider supports CNAME flattening, as this will affect your domain's MX records and email service.
5. For more instructions on your DNS setup, scroll down on the Domain tab to view additional DNS guidelines. Note: The DNS instructions vary depending on your domain configuration needs.
6. Once all DNS settings are configured, the domain will be successfully mapped. The status will be marked as "Valid" once it is successful.
Still not sure if your DNS provider supports CNAME flattening or when to use CNAME or A record? Here's a quick summary to guide you:
-
If you are setting up your blog at the root level (e.g. yourdomain.tld), use A record.
-
If you are setting up your blog on a subdomain (e.g. blog.yourdomain.tld), use the CNAME record.
Below is a table showing the most popular DNS providers and what type of domain record they support:
DNS Provider | Supports CNAME Flattening | Use CNAME Record (Root) | Use A Record (Root) |
---|---|---|---|
Namecheap | No | - | ✅ |
Cloudflare | Yes | ✅ | - |
GoDaddy | No | - | ✅ |
OpenDNS | No | - | ✅ |
Oracle Dyn Managed DNS | No | - | ✅ |
Cisco Umbrella | No | - | ✅ |
Amazon Route 53 | No | - | ✅ |
Google Cloud DNS | No | - | ✅ |
Hostinger | No | ✅ | ✅ |
IBM Domain Name Services (DNS) | Yes | ✅ | - |
Azure DNS | Yes | ✅ | - |