Create your own Private Nameservers

Registering your own private nameserver

So you want to register your own private nameserver? First it’s not
the same thing changing nameservers. It’s about creating alias for nameservers chosen by you.

Naming your nameserver
What is a nameserver? It contains your DNS zone and helps to converts name based domains to their IP counterparts.

You can name your nameserver anything! It is kept short so that customers and others
setting the nameserver for the domain don’t have too much trouble recognizing them.


Usually its very short and identifable like
ns1.thedomain.com
ns2.thedomain.com

But they can be unique like

theDNSserver001.thedomain.com
theDNSServer002.thedomain.com

1) Static IPs are recommended. They’re also known as dedicated IPs and work smoothly with
for giving unique IPs to websites and nameservers. Dedicated IPs provide anonmity, improve reputation and can resolve exclusively back to your nameservers. If you want to use unique IPs for your nameservers you can buy them from your webhost. The number of IPs you want should be equivalent to the number of nameservers you want to create, typically its just 2 (primary and a secondary)

Vanity/Branded nameserver
Using a branded nameserver, you’ll be using the webhost’s nameserver IPs which can be shared in most cases but using your desired name for those nameserver but letting your webhost manage the DNS for you. What is different is you’ll have to configure your DNS server (BIND for example)
on your end with the following configuration and then manage the zone files from your webhost’s DNS manager. Not all webhosts will allow this. Softlayer for example has forward zones that have locked NS records ns1.softlayer.com and ns2.softlayer.com and can’t be changed.

Sample desired nameserver (they look like private nameservers)
mask1.thedomain.com
mask2.thedomain.com

Add the following to thedomain’s DNS zone file:
A record name: mask1
Address: 67.228.254.4 [IP address for ns1.softlayer.com]
Record example (include the trailing dot)
A mask1.thedomain.com.

A record name: mask2
Address: 67.228.255.5 [IP address for ns2.softlayer.com]
Record example (include the trailing dot)
A mask2.thedomain.com.

Record Type: NS
Value: mask1.thedomain.com
Record example (include the trailing dot)
NS mask1.thedomain.com.

Record Type: NS
Value: mask2.thedomain.com
Record example (include the trailing dot)
NS mask2.thedomain.com.

Private Nameservers
Now the big kahuna! This part we’ll get into the nitty gritty details of setting up your private nameserver and using cPanel’s WHM (default BIND) as template to achieve that.

You can setup private nameservers using your public primary IP (shared IP) or dedicated IPs.

I’ll cover first setting up private nameservers using shared IP. The downside to this is that the nameservers don’t have dedicated IPs. Dedicated IPs essentially provide privacy of the main server’s IPs, can provide exclusive rDNS for those IPs and domains back to exclusive IPs.

Server side:
You’ll edit /etc/nameserverips and use the same public primary IP for NS1 and NS2
Next you’ll edit /var/cpanel/nameserverips.yaml and use the same public primary IP twice.
Restart /etc/named service

Registrar side:
Register private nameservers ns1 and ns2 (known as glue records) with the same public primary
IP of your server. Now after registering your nameserver, you’ll want to change the nameserver of your domain to the newly registered nameservers ns1.yourdomain.com and ns2.yourdomain.com

Private Nameservers with Dedicated IPs
If you plan to use Dedicated IPs, here are the steps:
If you are using WHM/cPanel, first add the IPs by going to WHM
“Add a New IP Address”

Server side:
Once both IPs have been added, open up SSH utility and you’ll need to edit the file /etc/nameserverips and use each dedicated IP for your first and second nameserver

Next you’ll edit /var/cpanel/nameserverips.yaml and input each of the dedicated IPs in there
Then restart /etc/named service

Registrar side:
Register private nameservers ns1 and ns2 (known as glue records) with the individual dedicated IP. Now after registering your nameserver, you’ll want to change the nameserver of your domain to the newly registered nameservers ns1.yourdomain.com and ns2.yourdomain.com

Leave a Reply

Your email address will not be published.