Table of Contents
Want your hosting customers to use nameservers such as ns1.yourdomain.com and ns2.yourdomain.com instead of your upstream provider’s nameservers? You can create branded, or private, nameservers by registering child nameserver hostnames with your domain registrar, configuring authoritative DNS on your server, and delegating your domain to those nameservers.
This guide explains how the pieces fit together and walks through the setup using cPanel & WHM or BIND on a Linux server. It also covers glue records, secondary DNS, testing and security. The examples use placeholder domains and IP addresses. Replace them with values assigned to your own infrastructure.
What Is a Private DNS Nameserver?
A private nameserver, often called a custom or vanity nameserver, is an authoritative DNS server identified by a hostname under your own domain. For example, a hosting provider might offer customers ns1.yourdomain.com and ns2.yourdomain.com rather than names under the upstream provider’s brand.
In this context, “private” describes the branding of the nameserver hostname. It does not mean the DNS service is private or hidden from the public internet. If the nameservers are authoritative for public domains, they must be reachable by public DNS resolvers.
Private nameservers are useful for hosting companies, resellers and agencies that manage DNS for multiple customer domains. They do not automatically mean that you own or operate a separate data centre. Your nameservers may still run on infrastructure supplied by another hosting provider.
Private Nameservers, Child Nameservers and Glue Records
These terms describe related parts of the setup, but they are not interchangeable:
- Private or vanity nameserver: the branded hostname, such as
ns1.yourdomain.com. - Child nameserver (host object): a hostname registered with the domain’s registrar or registry and associated with one or more IP addresses.
- Glue record: address information published by the parent zone to help resolvers find a nameserver when its hostname is inside the domain it serves.
- DNS delegation: the parent zone’s instruction identifying which nameservers are authoritative for a domain.
Glue is especially important for an in-bailiwick nameserver. For example, if yourdomain.com is delegated to ns1.yourdomain.com, a resolver needs an address for that nameserver before it can ask it for the domain’s DNS records. The parent zone supplies the glue address to break that circular dependency. Registrar interfaces and terminology vary, so follow the instructions for the registrar where the domain is registered.
How the Setup Fits Together
- Choose the nameserver hostnames and server IP addresses. For example,
ns1.yourdomain.comandns2.yourdomain.com. - Configure authoritative DNS. Set up the DNS service and the zones it will serve on your server or DNS platform.
- Register child nameservers with the registrar. Create the host objects and supply the correct IPv4 and, where supported, IPv6 addresses.
- Delegate the domain. Set the domain’s authoritative nameservers to the new hostnames.
- Test from outside your network. Check delegation, glue, authoritative responses and service availability.
These steps may be completed in a different order depending on your provider, but the DNS service and its records should be ready before you move live domains to the new nameservers.
What You Need Before You Begin
- A registered domain that you control, such as
yourdomain.com. - Access to the domain registrar’s DNS or host-record management area.
- One or preferably two stable server IP addresses. Separate servers and networks are preferable for resilience.
- Authoritative DNS software or a managed DNS service. Common options include PowerDNS and BIND.
- Administrative access to configure the DNS service, firewall and monitoring.
- A plan for DNS records, including website, email and verification records.
Do not assume that a shared hosting account allows you to run nameserver software or register custom nameservers. These capabilities depend on the hosting plan, server permissions and registrar. If you only need to manage records for a website, your registrar’s or DNS provider’s nameservers may be simpler and more reliable.
Method 1: Configure Private Nameservers in cPanel & WHM
This method is for administrators with the required WHM privileges on a cPanel & WHM server. The current cPanel documentation describes selecting nameserver software, setting default nameserver hostnames, creating address records and registering the nameservers with the registrar. The exact screens can vary by version and reseller permissions.
Step 1: Select the nameserver software
Sign in to WHM with an account that has the necessary server privileges. Open WHM > Home > Service Configuration > Nameserver Selection, choose the supported DNS software and save the selection. cPanel & WHM commonly uses PowerDNS by default; BIND is another option where supported. Do not enable a nameserver service unless you intend to operate it.
Step 2: Set the default nameserver hostnames
Open WHM > Home > Server Configuration > Basic WebHost Manager Setup. Find the Nameservers section and enter the hostnames you plan to use, for example:
ns1.yourdomain.comns2.yourdomain.com
Save the changes. Use unique names for each nameserver and make sure the hostnames match the names you intend to register with your registrar.
Step 3: Configure address records
Next to each nameserver, use Configure Address Records to create or confirm its address record. Enter the correct IPv4 address for an A record and, if you operate IPv6 on that nameserver, the correct IPv6 address for an AAAA record. Do not publish an IPv6 address unless the server is genuinely reachable over IPv6.
If the nameserver hostnames are in the same domain being served, the registrar’s child-host registration may also publish the corresponding glue information in the parent zone. The address records in your own DNS zone and the glue at the parent are related, but they are not the same record in the same place.
Step 4: Register the nameservers with your registrar
Sign in to the registrar where yourdomain.com is registered. Find an option such as Register Nameservers, Child Nameservers, Personal DNS Server or Host Records. Register each hostname with its assigned IP address:
| Hostname | Example address |
|---|---|
ns1.yourdomain.com |
192.0.2.10 |
ns2.yourdomain.com |
192.0.2.20 |
The addresses above are documentation-only examples from the reserved TEST-NET ranges. Do not copy them into a live configuration. Use the real IP addresses assigned to your DNS servers. Registrar procedures differ, so consult your registrar’s current instructions if you cannot find the host-record area.
Step 5: Delegate your domain to the new nameservers
After the nameserver service and host records are ready, update the domain’s nameserver settings at the registrar to use ns1.yourdomain.com and ns2.yourdomain.com. Registering a child nameserver does not, by itself, change the domain’s delegation. These are separate registrar actions.
For cPanel’s official walkthrough, see How to Set Up Nameservers in a cPanel & WHM Environment.
Method 2: Configure Private Nameservers with BIND on Linux
Use this method when you administer a Linux server directly and are responsible for its DNS service. The examples are illustrative. File paths, service names and package versions can differ between distributions. If your server is managed by a control panel, use its supported DNS configuration workflow rather than editing generated files manually.
Step 1: Install BIND
On Debian or Ubuntu systems where BIND is available from the configured package repositories, an administrator can install the packages with:
sudo apt update
sudo apt install bind9 bind9-utils
On other distributions, use the package manager and package names documented for that operating system. Keep BIND and the operating system updated.
Step 2: Define the authoritative zone
Configure BIND to load the zone for your domain. A simplified primary-zone declaration may look like this in the appropriate BIND configuration file:
zone "yourdomain.com" {
type primary;
file "/etc/bind/zones/db.yourdomain.com";
};
Use the configuration include structure and directory conventions for your distribution. Ensure the zone file is readable by the BIND service account and that configuration files are protected from unauthorised modification.
Step 3: Create the zone file
A simplified zone file for yourdomain.com could look like this:
$TTL 3600
@ IN SOA ns1.yourdomain.com. hostmaster.yourdomain.com. (
2026110901 ; serial: increment after each zone change
3600 ; refresh
900 ; retry
1209600 ; expire
300 ; negative caching TTL
)
@ IN NS ns1.yourdomain.com.
@ IN NS ns2.yourdomain.com.
ns1 IN A 192.0.2.10
ns2 IN A 192.0.2.20
@ IN A 192.0.2.30
www IN CNAME yourdomain.com.
This is a teaching example, not a complete production zone. Replace the documentation-only addresses with the real addresses for your environment. Add and validate the MX, TXT, AAAA and other records required by your services. The trailing dots on fully qualified domain names in zone files are important. Ensure the SOA serial is increased whenever you publish a zone change.
Step 4: Validate the configuration and reload BIND
Before reloading the service, check the main configuration and the zone file. For example:
sudo named-checkconf
sudo named-checkzone yourdomain.com /etc/bind/zones/db.yourdomain.com
Correct any reported errors before proceeding. Then reload the BIND service using the service name for your distribution, for example:
sudo systemctl reload bind9
Check the service status and system logs. A successful reload does not prove that public delegation or external connectivity is correct, so continue with the tests later in this guide.
Configure a Secondary Nameserver
Two nameserver hostnames do not automatically provide redundancy. If both hostnames resolve to the same server, share the same network path or depend on the same power and connectivity, one incident can take both offline. For important domains, use separate systems and, where possible, separate networks or locations.
In a BIND primary/secondary arrangement, the primary serves the writable zone and the secondary obtains zone data through DNS zone transfers. A simplified primary-zone configuration can restrict transfers to the secondary server:
zone "yourdomain.com" {
type primary;
file "/etc/bind/zones/db.yourdomain.com";
allow-transfer { 192.0.2.20; };
also-notify { 192.0.2.20; };
};
The secondary server needs a corresponding secondary-zone declaration. For example:
zone "yourdomain.com" {
type secondary;
file "/var/cache/bind/db.yourdomain.com";
primaries { 192.0.2.10; };
};
These snippets must be adapted to your BIND version, filesystem permissions and network design. Restrict zone transfers to authorised secondary servers, use appropriate authentication such as TSIG where supported, and permit the required DNS traffic between the servers. Do not expose unrestricted AXFR transfers to the public.
For a deeper explanation of authoritative DNS design and zone transfers, consult the ISC BIND authoritative-server best practices and its guidance on BIND zone transfers.
Test Your Private Nameserver Configuration
Test from a machine outside the DNS server’s network where possible. Replace the example domain and IP addresses with your actual values.
1. Check the domain’s delegated nameservers
dig NS yourdomain.com
Confirm that the response lists the intended authoritative nameservers. This query uses the resolver configured on your machine; it is useful as a first check but does not by itself confirm that every parent delegation is correct.
2. Check the parent zone and glue
Query the appropriate parent or registry nameserver for your domain’s top-level domain. For a .com example, you can inspect the parent response with:
dig @a.gtld-servers.net yourdomain.com NS
Review the authority and additional sections. For in-bailiwick nameservers, confirm that the glue addresses match the current addresses of the authoritative servers. The correct parent server depends on the domain’s extension.
3. Query each authoritative server directly
dig @192.0.2.10 yourdomain.com SOA
dig @192.0.2.10 yourdomain.com NS
dig @192.0.2.20 yourdomain.com SOA
Both servers should return authoritative answers for the zone. Compare the SOA serial numbers to confirm that the secondary has received the latest zone version.
4. Check website and mail records
dig @192.0.2.10 yourdomain.com A
dig @192.0.2.10 yourdomain.com MX
dig @192.0.2.10 yourdomain.com TXT
Confirm that the responses contain the values your website, email provider and verification services require. A nameserver can answer NS queries correctly while individual A, MX or TXT records are still missing or incorrect.
Common Private Nameserver Problems
| Problem | What to check |
|---|---|
| Nameserver hostname does not resolve | Check the child-host registration, parent glue where required, and A/AAAA records in the authoritative zone. |
| Domain reports SERVFAIL | Check delegation, authoritative server reachability, zone loading and DNSSEC/DS records. |
| One nameserver has old records | Compare SOA serials, check NOTIFY and zone-transfer permissions, and inspect secondary-server logs. |
| Queries time out | Confirm the DNS service is listening on the public interface and that TCP and UDP port 53 are permitted by the firewall and network provider. |
| Website works but email fails | Review MX, A/AAAA and mail-provider TXT records. Nameserver setup does not create correct mail records automatically. |
| DNSSEC validation fails | Check that the DS record at the parent matches the active DNSKEY and signing configuration. Incorrect or stale DS data can make a domain fail validation. |
For further diagnostics, Google’s domain troubleshooting guide explains how to investigate delegation, authoritative-server health and DNSSEC problems.
Security and Reliability Best Practices
- Use independent servers: place primary and secondary nameservers on separate systems and, where practical, separate networks or locations.
- Restrict zone transfers: allow transfers only to authorised secondary servers and use authenticated transfer controls where supported.
- Do not run an open resolver: public authoritative DNS should not unintentionally provide unrestricted recursive DNS service to the internet.
- Protect management access: use SSH keys, strong access controls, least privilege and timely security updates.
- Monitor availability: monitor authoritative responses, service health, SOA serial consistency and expiry of relevant domain registrations.
- Back up zone data: keep tested backups and document how to restore the DNS service.
- Plan DNSSEC carefully: if you sign zones, coordinate DNSKEY and DS changes with the parent registrar or registry. Do not publish a DS record that does not match the active signing keys.
- Document every change: record IP assignments, registrar host objects, zone files, TTL values and the person responsible for updates.
For authoritative operational guidance, see the ISC recommendations for authoritative BIND servers.
Frequently Asked Questions
Do I need two IP addresses to create private nameservers?
You need reachable address records for the nameservers you publish. Two distinct IP addresses and independently operated servers are recommended for resilience, but simply assigning two IP addresses to one machine does not provide true server redundancy. Ask your hosting provider what address and network options are available.
Can I create private nameservers on shared hosting?
Usually, a standard shared hosting account does not give you the privileges needed to operate authoritative DNS software or configure server-level services. Some providers offer branded reseller nameservers as part of a reseller plan. Confirm the feature with your provider before registering hostnames.
Are private nameservers the same as private DNS?
No. Private nameservers in this guide are branded authoritative nameservers for domains. Private DNS can also refer to internal DNS zones or encrypted DNS services. Check which meaning applies to your particular requirement.
Does registering child nameservers automatically point my domain to them?
No. Registering the child hostnames and their addresses makes the nameserver host objects known to the registrar or registry. You must also configure the DNS service and update the domain’s delegation to use those nameservers.
How long does it take for private nameservers to work?
There is no universal propagation time. Registrar processing, parent-zone publication, cached delegation data and record TTLs all affect when different resolvers see the change. Test the parent delegation and query the authoritative servers directly instead of relying only on a propagation checker.
Can I use the same private nameservers for multiple customer domains?
Yes, a hosting provider can operate a set of authoritative nameservers for many domains. Each customer domain still needs its own correctly configured DNS zone and delegation. Keep customer zones isolated and ensure that each domain’s records are maintained accurately.
Conclusion
Setting up private DNS nameservers involves more than choosing branded hostnames. You must configure authoritative DNS, register child nameservers and any required glue records with the registrar, delegate the domain, and test that the primary and secondary servers respond correctly.
For cPanel & WHM administrators, use the supported WHM nameserver configuration workflow. For administrators managing DNS directly, configure and validate BIND carefully, restrict zone transfers and build in independent redundancy. Once the setup is working, document it and monitor it as part of your hosting infrastructure.
If you want to strengthen your understanding of DNS before making changes, read our guides to how DNS works with web hosting, nameserver propagation and common DNS records.















