How to get your own nameservers like ns1.yourdomain.com
Is there a bigger flex than having your small website show up with custom domain names in the NS DNS records? Probably not. And having your own nameserver addresses allows you to more easily move between registrars in certain scenarios. It’s actually not difficult to set this up if you know what to do in what order.
Let’s take a look at the three things you need for this setup: a registrar supporting glue records, a DNS host supporting custom nameservers and a domain name (ideally one separate from that of your website but for personal use cases it doesn’t matter).
I have tested this with both Namecheap and Infomaniak as registrars and Bunny DNS. Custom nameservers are not a standard feature with all hosts. Cloudflare requires a business plan for it for example.
Step 1 - Setting glue records
I’ll demonstrate the steps with Bunny DNS. First up, we need to head to our DNS host and find the custom nameserver section to find the host’s IP addresses. On Bunny1, this option is located in DNS > the domain name > Nameservers. It looks a bit different from mine as I’ve already set it up but it’s not complicated.
Copy the first IP address, which corresponds to your first nameserver. You probably already know that there is always at least two of them, and you can name them both differently.
With the IP copied, head to your registrar’s glue records options. It will probably be hidden in advanced settings somewhere because it’s easy to break your availability when messing something up. The glue records, which you need two of (one for each nameserver), consists of a subdomain (in my case dns1 but you can pick whatever you want) and an IP address (the one you just copied).
So create a new glue record with these two values. When you are done, copy the next IP (nameserver two) from your DNS host and create a glue record for it too. There doesn’t have to be a pattern to your naming convention, you can pick two completely different names if you’d like to.
Step 2 - Everything else
When the glue records are set, we next need to head back to our DNS host and specify the nameserver domains for their corresponding IP addresses as you can see in the screenshot.
There is one last thing we have to do now for our nameservers to show up in the DNS records. Head to your registrar again and change your custom nameservers from whatever defaults your DNS host has (in this case coco.bunny.net and kiki.bunny.net) to your custom nameservers. Save the changes and that’s it! For them to take effect, as usual, it may take anywhere between a few minutes and hours. Make sure your site is still reachable once they take effect.
I can highly recommend both Bunny DNS and CDN in general. Their support and pricing are great. If you want to check them out feel free to use my referral link which gives me some usage credit :): https://bunny.net?ref=yosmrsvifw ↩