Setup & Tech Guides8 min read•Last updated: •By SkyRain Cloud Team

How to Set Up Private Nameservers on a Dedicated Server

Agencies, resellers and hosting businesses often want their clients' domains to point to ns1.youragency.com and ns2.youragency.com instead of a provider's generic nameservers. These private nameservers (also called custom, vanity or white-label nameservers) make your brand visible in every client's DNS settings and let you move clients between servers without asking them to change anything at their registrar.

Setting them up involves three pieces that must agree with each other: glue records at your domain registrar, a DNS server that answers for your zones, and a firewall that lets DNS traffic in. This guide covers all three, the redundancy question most guides skip, and how to test the result.

Quick answer

To set up private nameservers: (1) get at least two IP addresses; (2) at the registrar of your main domain, register child nameservers (glue records) such as ns1.example.com and ns2.example.com pointing to those IPs; (3) run a DNS server (BIND, PowerDNS, or the DNS built into cPanel or Plesk) that is authoritative for your zones, with A records for ns1 and ns2; (4) open TCP and UDP port 53; (5) disable open recursion; (6) point client domains to ns1/ns2 and verify with dig. For real redundancy, the two nameservers should be on separate servers or networks.

How private nameservers work

When someone visits clientsite.in, resolvers ask the .in registry which nameservers are responsible. If the answer is ns1.example.com, there is a chicken-and-egg problem: to find ns1.example.com you would need to ask example.com's nameservers, which are ns1.example.com. Glue records break the loop. They are IP addresses for ns1 and ns2 that the registry for example.com publishes directly, so resolvers can reach your DNS server without first resolving its name.

PieceWhere it livesWhat it says
Glue (child nameserver) recordsRegistrar of example.comns1.example.com = 203.0.113.10, ns2.example.com = 203.0.113.11
Nameserver delegationRegistrar of each client domainclientsite.in uses ns1.example.com and ns2.example.com
Zone filesYour DNS serverThe actual A, MX, TXT and other records for each domain
Private nameservers – SkyRain Cloud bare metal servers in India

One server or two? The redundancy question

Registrars require at least two nameservers, and the reason is resilience: if one fails, the other keeps answering. The Internet standard on this, RFC 2182, recommends placing secondary DNS servers on different networks.

Many people put both ns1 and ns2 on two IP addresses of the same dedicated server. It works, and it satisfies the registrar, but if that server goes down, every domain it serves stops resolving, including email. Better options, in order:

  1. Two servers in different data centers, for example one in Mumbai and one in Delhi, with zones synchronised.
  2. Your server as primary plus a secondary DNS service that copies your zones by zone transfer.
  3. Two IPs on one server: acceptable for testing or small setups, with good monitoring.

Extra IPv4 addresses for this purpose are available on SkyRain Cloud dedicated servers; our guide to dedicated IP addresses explains how they are used.

Step 1: Register the glue records

Log in to the registrar where your own domain (example.com) is registered. Look for a section called Child Nameservers, Register Nameservers, Host Records or Glue Records. Create:

  • ns1.example.com → your first IP
  • ns2.example.com → your second IP

Registry updates can take from minutes to a day to appear everywhere.

Step 2: Run an authoritative DNS server

With cPanel/WHM or Plesk

Control panels include a DNS server. In WHM, set the nameserver names under Basic WebHost Manager Setup, add A records for ns1 and ns2, and every new account's zone will use them. Plesk has an equivalent DNS template. If you have not installed a panel yet, see our cPanel installation guide.

With BIND on Ubuntu or Debian

sudo apt install bind9 bind9-utils

In /etc/bind/named.conf.options, make the server authoritative only:

options {
    directory "/var/cache/bind";
    recursion no;
    allow-transfer { none; };
    listen-on { any; };
};

Declare your own zone in /etc/bind/named.conf.local:

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

Create the zone file /etc/bind/zones/db.example.com:

$TTL 3600
@   IN SOA ns1.example.com. admin.example.com. (
        2026112301 ; serial (date + number)
        3600       ; refresh
        900        ; retry
        1209600    ; expire
        300 )      ; negative cache TTL
    IN NS  ns1.example.com.
    IN NS  ns2.example.com.
ns1 IN A   203.0.113.10
ns2 IN A   203.0.113.11
@   IN A   203.0.113.10
www IN A   203.0.113.10

Check and load it:

sudo named-checkconf
sudo named-checkzone example.com /etc/bind/zones/db.example.com
sudo systemctl reload named

Add a zone like this for each client domain. Increase the serial every time you edit a zone, or secondary servers will not pick up the change.

Step 3: Open port 53 and keep recursion off

DNS uses UDP port 53 for most queries and TCP port 53 for large responses and zone transfers. With UFW:

sudo ufw allow 53/udp
sudo ufw allow 53/tcp

The recursion no; setting above is important. An authoritative server that also answers recursive queries for anyone is an open resolver, which attackers abuse to amplify DDoS attacks against third parties. It can also get your IP addresses blocklisted. For the rest of your firewall, see our dedicated server firewall guide.

Step 4: Test before you move clients

dig @203.0.113.10 example.com SOA +short
dig @203.0.113.11 www.example.com A +short
dig ns1.example.com A +short
dig example.com NS +trace

The first two ask your servers directly. The third checks that the glue records are visible. The last follows delegation from the root servers down to yours, showing exactly where a problem sits. Then, for each client domain, change its nameservers at its registrar to ns1/ns2 and test the same way.

Common mistakes

  • Glue records with the wrong IP, or created at the client's registrar instead of yours.
  • Forgetting the A records for ns1 and ns2 inside your own zone.
  • Port 53 open on UDP only: large answers then fail intermittently.
  • Not increasing the zone serial after edits.
  • Both nameservers on one server with no monitoring. If you do this, watch it closely; see our guide for agencies on planning for growth.

Why businesses choose SkyRain Cloud dedicated servers

Running your own DNS works best on stable, well-connected hardware. SkyRain Cloud dedicated servers offer:

  • Indian data centers, Indian latency. Intel Xeon dedicated servers are hosted in Mumbai and Delhi, close to customers across India.
  • The whole machine is yours. 100% unshared hardware: no other tenants competing for CPU, memory or disk.
  • DDoS protection included on the network, so a flood aimed at your IP does not have to become your problem alone.
  • Full control. Root or Administrator access plus iLO/IPMI out-of-band management to reboot, reinstall or mount your own ISO.
  • Real support channels. 24/7 support tickets, WhatsApp and a Discord community, plus a public status page.
  • Simple billing. Monthly billing in rupees with UPI, net banking and cards.

Frequently Asked Questions

What are private nameservers?
Nameservers named after your own domain, such as ns1.example.com and ns2.example.com, used instead of your hosting provider's generic nameservers.
What is a glue record?
An IP address for a nameserver, published by the registry of its parent domain, so resolvers can find ns1.example.com without first resolving example.com.
Do I need two IP addresses for private nameservers?
Registrars require two nameservers. They can use two IPs on one server, but for real redundancy put them on separate servers or use a secondary DNS service.
How long do private nameservers take to work?
Glue records usually appear within minutes to a few hours, but full propagation can take up to 24-48 hours depending on registries and caches.
Which ports does a DNS server need?
Port 53 on both UDP and TCP. UDP handles most queries; TCP is used for large responses and zone transfers.
What is an open resolver and why avoid it?
A DNS server that answers recursive queries for anyone. Attackers abuse open resolvers to amplify DDoS attacks, so authoritative servers should have recursion disabled.

Conclusion

Private nameservers put your brand on every client domain and make moving clients between servers painless. The setup is glue records at your registrar, an authoritative DNS server with recursion disabled, port 53 open on both UDP and TCP, and careful testing with dig. Treat redundancy seriously: two servers or a secondary DNS service turns a single point of failure into a resilient service.

To run DNS, hosting and email on your own hardware, see our dedicated servers.

SkyRain Cloud Dedicated Server Plans

Unshared Intel Xeon bare-metal servers in Mumbai and Delhi data centers with 1 Gbps connectivity. Every plan includes iLO / IPMI out-of-band management, DDoS protection, Full root / Administrator access, Additional IPv4 addresses available and Billed monthly.

PlanCores / ThreadsRAMStorageNetworkPriceGood forBuy
Business
2× Intel Xeon E5-2699 v4 (Mumbai / Delhi)
44 / 88 (2.2 GHz base, 3.6 GHz turbo)128 GB DDR4 ECC1 TB NVMe SSD1 Gbps₹17,999/monthBusiness websites, stores, databases, ERP and many client sitesOrder
Enterprise
2× Intel Xeon Platinum 8269CY (Mumbai / Delhi)
52 / 104 (2.5 GHz base, 3.8 GHz turbo)128 GB DDR4 ECC1 TB NVMe SSD1 Gbps₹19,999/monthVirtualization hosts, large databases, SaaS and container platformsOrder
CustomMore RAM or storage, a second server for failover, or several servers for a cluster: quoted by the team.Clusters, failover pairs, unusual specsAsk

Prices are monthly in INR as listed on the SkyRain Cloud store (verified 2026-11-23). Live stock and final price are shown at checkout.

Instant UPI • ₹649/mo
Fast KVM Cloud Provisioning