How To Set Up Private Nameserver For Linux Server
Most users will want to use a domain name they already own, often the same domain name that is being used for the hostname of the server that will be running the private nameservers.
For this example, we will use a fake domain called yourdomain.com. Our server is called host.yourdomain.com and we will be setting up ns1.yourdomain.com and ns2.yourdomain.com.
There are three parts to setting your private nameservers:
- Configuring the server to accept and process the DNS requests
- Registering your new nameservers at the registrar who controls the domain name
- Pointing domains at those new nameservers
This article will guide on how to create a private nameserver for a Linux server.
For Linux server installed cPanel:
1. Log in to your WHM with URL: yourserverIPaddress/whm and find the navigation section on the left called Basic cPanel & WHM Setup, at the bottom, you will find the Nameservers section.
2. When you load this screen for the first time you may see that is two nameservers, using the same domain name as the server’s hostname are already in place. You may change the hostname and assign the IP address for the nameserver.
3. Key in the new nameserver such as ns1.yourdomainname.com and assign the IP address. You need to have at least two nameserver names configured, so repeat this step to create your second nameserver.
4. When finished assigning IP addresses, make sure to click Save Changes (3).
5. If the domain name for example yourdomainname.com is yet to add to WHM, you may need to create a new Cpanel account or add the DNS zone for yourdomainname.com to enable the DNS for the domain name.
6. To add the DNS in WHM, go to the DNS function and click on Add a DNS Zone.
7. Key in yourdomainname.com and add it with your server IP, then click on Add Zone.
8. Once the DNS zone successfully added, go to Edit DNS Zone, select yourdomainname.com from the list, add below A record for your nameserver under Add New Entries:
ns1: A record: your nameserver IP address
ns2: A record: your nameserver IP address
9. Click on Save to save the setting.