Net2Secure: A Leading Data Center Service Provider in India

Home Knowledge Base VPS Hosting /

How to Set Up Private Name Servers for VPS and Dedicated Servers?


Net2Secure welcomes you to the latest series of informational guides. Today, you will learn how to configure private nameservers for your VPS or Dedicated server. Doesn’t matter if you are a web hosting providers, reseller, digital agency, or business managing multiple websites; private nameservers enable you to set a professional DNS infrastructure while maintaining full control over your domain’s name resolution. 

By default, most hosting providers assign their own nameservers, such as ns1.provider.com and ns2.provider.com, to handle DNS records. While these nameservers function effectively, they represent the provider’s branding instead of your own. Private nameservers, on the other hand, allow you to create branded nameservers such as ns1.yourdomain.com and ns2.yourdomain.com, boosting your organization’s professional image and reinforcing your brand identity. 

Furthermore, private nameservers deliver better administrative control over your DNS environment. They simplify website and customer management, enable you to host multiple domains under a unified DNS infrastructure, and are particularly valuable for businesses delivering reseller hosting, VPS Server hosting, dedicated servers, or managed hosting services. Since DNS is responsible for translating domain names into IP addresses, properly configured nameservers are vital for ensuring websites, email services, and other online applications remain accessible and reliable. 

In this post, you will learn the complete process of setting up private nameservers on your VPS or Dedicated server hosting. In addition, you will learn how to create child nameservers at your domain registrar, configure DNS records on your server, assign the accurate IP addresses, update your domain to use the newly created nameservers, and verify that everything is functioning properly.

Learn What Private Nameservers Are

Private nameservers, generally known as custom nameservers, refer to DNS nameservers that use your own domain name instead of your hosting provider’s domain. For example, instead of using generic nameservers like ns1.hostingprovider.com and ns2.hostingprovider.com, you can create branded nameservers such as ns1.yourdomain.com and ns2.yourdomain.com. 

Private nameservers do the same function as standard nameservers. They direct your domain to the correct web server. The only difference is that they represent your own domain name, giving your hosting environment a more professional and branded appearance. 

Using private nameservers is crucial if you are operating a VPS or Dedicated Server, handling various websites, or operating a web hosting business. They enable you to create a consistent brand identity, making your services appear more reliable and professional to your clients. 

For instance, if your domain is example.com, you can configure your own private nameservers as: 

Once configured, these nameservers can be used to handle your domain’s DNS records or deliver branded DNS services for customer domains hosted on your server.

Step-by-step guide to set up private nameservers on VPS and dedicated servers

Step 1: Register Your Private Nameservers

The first step is to register your private nameservers with your domain registrar. This allows the global DNS system to recognize your custom nameservers.

1. Log in to Your Domain Registrar

Sign in to the control panel where your domain is registered.

2. Locate the Nameserver Registration Section

Depending on your registrar, this option may appear as:

3. Create Your Private Nameservers

Register two nameservers using your domain name and assign them the static IP addresses of your VPS or Dedicated Server.

Example:

Nameserver

IP Address

ns1.yourdomain.com

192.0.2.1

ns2.yourdomain.com

192.0.2.2

4. Save the Changes

After registration, your registrar will publish the glue records. DNS propagation may take several hours, depending on the registrar.

Step 2: Install and Configure Private Nameservers in Panels (WHM/Plesk/CyberPanel)

For WHM Panel,  

For Plesk Panel,

For CyberPanel,

After registering the nameservers, configure a DNS server on your VPS or Dedicated Server.

This guide uses BIND (Berkeley Internet Name Domain), one of the most widely used DNS server applications.

Install BIND

Connect to your server via SSH.

Ubuntu/Debian

sudo apt update
sudo apt install bind9

CentOS/RHEL
sudo yum install bind

Configure DNS Zones

Open the BIND local configuration file.
sudo nano /etc/bind/named.conf.local

Add your forward and reverse DNS zones.

zone "yourdomain.com" {
    type master;
    file "/etc/bind/zones/db.yourdomain.com";
};

zone "2.0.192.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/db.192.0.2";
};

Save and close the file.

Create the Zone Directory

sudo mkdir -p /etc/bind/zones

Create the Forward Zone File

sudo nano /etc/bind/zones/db.yourdomain.com

Paste the following configuration:

$TTL 86400

@   IN  SOA ns1.yourdomain.com. admin.yourdomain.com. (
        2024062701
        3600
        1800
        1209600
        86400 )

@       IN  NS  ns1.yourdomain.com.
@       IN  NS  ns2.yourdomain.com.

ns1     IN  A   192.0.2.1
ns2     IN  A   192.0.2.2

Create the Reverse Zone File

sudo nano /etc/bind/zones/db.192.0.2

Add the following configuration:

$TTL 86400

@   IN  SOA ns1.yourdomain.com. admin.yourdomain.com. (
        2024062701
        3600
        1800
        1209600
        86400 )

@       IN  NS  ns1.yourdomain.com.
@       IN  NS  ns2.yourdomain.com.

1       IN  PTR ns1.yourdomain.com.
2       IN  PTR ns2.yourdomain.com.

Restart the BIND Service

 

After saving the configuration files, restart BIND to apply the changes.
sudo systemctl restart bind9

You can also verify the configuration before restarting:

sudo named-checkconf

sudo named-checkzone yourdomain.com /etc/bind/zones/db.yourdomain.com

Step 3: Allow DNS Traffic Through the Firewall

DNS uses TCP and UDP port 53. Ensure both ports are open on your server.

Ubuntu/Debian (UFW)
sudo ufw allow 53/tcp
sudo ufw allow 53/udp

CentOS/RHEL (Firewalld)
sudo firewall-cmd --permanent --add-port=53/tcp
sudo firewall-cmd --permanent --add-port=53/udp
sudo firewall-cmd --reload

Step 4: Update Your Domain to Use the Private Nameservers

Once everything is configured:

  1. Log in to your domain registrar.
  2. Open your domain's DNS or Nameserver settings.
  3. Replace the default nameservers with your private nameservers.

    For example:

    ns1.yourdomain.com
    ns2.yourdomain.com

  4. Save the changes
    Your domain will begin using your custom nameservers after DNS propagation is complete.

Step 5: Verify DNS Resolution

From a Linux system, run:

dig NS example.com

Expected output:

example.com. IN NS ns1.example.com.
example.com. IN NS ns2.example.com.

Test your nameserver directly:

dig @ns1.example.com example.com

Or use:

nslookup example.com ns1.example.com

You can also verify propagation using online DNS lookup tools.

Troubleshooting Tips

If your private nameservers are not working correctly, try the following checks:

  • Verify that there are no syntax errors in your BIND configuration files using named-checkconf.
  • Confirm that both nameservers are properly registered with your domain registrar.
  • Ensure the server's public IP addresses are correct.
  • Verify that TCP and UDP port 53 are open in the firewall.
  • Restart the BIND service after every configuration change.
  • Review system logs (/var/log/syslog or /var/log/messages) for DNS-related errors.
  • Use tools such as dig, nslookup, or online DNS propagation checkers to verify that your nameservers are resolving correctly.


Anurag Soam

By Anurag Soam

A skilled Technical Content Writer with an unwavering dedication to covering complex concepts and specializing in writing explicit, concise, and SEO-friendly content for diverse audiences. With a solid background in technology, including SaaS, PaaS, IaaS, Documentation, Cloud, Cybersecurity, and DevOps, he’s an expert in curating content that enhances user experience and facilitates product success. He’s constantly updated on the latest industry trends and tools to deliver qualitative technical content.

View all of Anurag Soam's posts.

Contact Us


Related VPS Hosting Posts

We use cookies

By continuing to browse this site, you are agreeing to the use of cookies to enhance your experience.