
A DNS outage feels “mysterious” because your web server can be healthy while nobody can resolve the domain. The fix is usually architectural, not magical. Don’t keep DNS on one machine.
Run a small cPanel DNS cluster instead. This cPanel DNS cluster setup guide tutorial shows a simple two-node DNS-only design. It keeps working through reboots, maintenance windows, and the occasional bad update.
This walkthrough is for WHM/cPanel admins, resellers, and agencies managing multiple domains.
You’ll build two DNS-only nodes and attach them to your primary cPanel server through DNS clustering. Then you’ll push zones and verify propagation with checks you can repeat any time.
What you’ll build (and why it works)
A practical baseline for 2026 looks like this:
- 1 primary cPanel/WHM server that hosts sites and acts as the “write” source for DNS zones.
- 2 DNS-only nodes that answer authoritative DNS for your domains. No websites, minimal moving parts.
- Glue + NS records that point at the DNS-only nodes, not the web server.
Two authoritative servers keep domains resolving when one node goes offline.
Separating DNS from web hosting also reduces exposure on the server that must accept public DNS traffic.
Prerequisites and sizing checklist
Do these checks before you touch WHM. Most “DNS is weird” incidents start with skipped basics.
- Access: root WHM access to the primary server and root SSH access to both DNS-only nodes.
- Network: each DNS node needs a static public IPv4. IPv6 is a plus if your upstream supports it.
- Ports: inbound UDP/TCP 53 open to the world on DNS nodes; inbound 2087/2086 (WHM) should be restricted to your admin IPs only.
- Time: NTP/chrony enabled. Clock drift causes annoying, hard-to-trace failures.
- Plan for DNS migration: lower TTLs ahead of cutover (details below).
If you still need to lock down SSH before exposing new nodes, follow the safer login defaults in SSH key setup tutorial for Ubuntu VPS.
Hosting note: DNS-only nodes are a good fit for a small HostMyCode VPS because they’re CPU-light and have predictable bandwidth.
Size the primary cPanel box separately based on accounts, mail load, and storage.
Step 1 — Provision two DNS-only nodes (OS + cPanel DNSOnly)
cPanel’s DNSOnly is built for this exact job. Depending on your build, it may show up as a “cPanel DNSOnly / PowerDNS / BIND” package.
Start clean. Deploy a fresh OS, then install DNSOnly.
Recommended OS choices in 2026
- AlmaLinux 9 or Rocky Linux 9 for cPanel compatibility and stable behavior.
- Keep the DNS nodes on the same major OS family as your cPanel server when possible. It makes troubleshooting calmer.
Initial server hygiene
On each DNS node:
dnf -y update
reboot
Set the hostname to something DNS-specific:
hostnamectl set-hostname ns1.example.net
# and on node 2:
hostnamectl set-hostname ns2.example.net
Add basic firewall rules (keep it boring and explicit). If you’re using firewalld:
firewall-cmd --permanent --add-service=dns
firewall-cmd --permanent --add-service=ssh
firewall-cmd --reload
Do not expose WHM to the world. Restrict 2087/2086 at the network edge or via firewalld rich rules to your office/VPN IPs.
Install cPanel DNSOnly
On each DNS node, install DNSOnly using cPanel’s supported installer flow for DNS-only. The official install method changes occasionally.
Follow cPanel’s current DNSOnly docs for 2026, and confirm you’re installing DNSOnly (not full cPanel).
After installation, log in to WHM on the node and confirm the DNS service is running.
Quick service check (BIND example):
systemctl status named
ss -lntup | egrep ':53\b'
If port 53 is listening on both UDP and TCP, you can move on to clustering.
Step 2 — Decide on nameserver hostnames and IPs (NS1/NS2 planning)
Pick nameserver hostnames you can keep for years. Common patterns:
ns1.yourbrand.comandns2.yourbrand.comdns1.yourbrand.comanddns2.yourbrand.com
Write down:
- NS1 hostname + IPv4 (and IPv6 if used)
- NS2 hostname + IPv4 (and IPv6 if used)
- Which node maps to which hostname (don’t “swap later”)
Pitfall: don’t point ns1/ns2 at your main cPanel server “temporarily.” Temporary DNS has a habit of becoming permanent.
Then you’re back to a single point of failure.
Step 3 — Create glue records at your domain registrar
If your nameservers live under your own domain (for example, ns1.yourbrand.com), you must create “child nameserver” (glue) records at the registrar for yourbrand.com.
This is required for delegation to work reliably.
- Log in to your registrar for
yourbrand.com. - Find Child Nameservers, Host Records, or Glue Records.
- Create:
ns1.yourbrand.com→ NS1 public IPns2.yourbrand.com→ NS2 public IP
- Then set the domain’s authoritative nameservers to
ns1.yourbrand.comandns2.yourbrand.com.
If you need a clean DNS cutover plan for production domains, keep the steps tight and reversible. This pairs well with DNS propagation tutorial.
Product note: if you’re also consolidating domain registrations, managing glue and NS changes is easier when domains live under one panel. See HostMyCode Domains for straightforward DNS and registration management.
Step 4 — Configure basic nameserver settings on the primary WHM
On your main cPanel/WHM server:
- Go to WHM → Basic WebHost Manager Setup.
- Set:
- Primary Nameserver:
ns1.yourbrand.com - Secondary Nameserver:
ns2.yourbrand.com
- Primary Nameserver:
- Assign the correct IPs for these nameservers (use the DNS-only node IPs, not the web server IP).
Watch for WHM “helpfully” mapping nameservers to the primary server’s address. If it does, correct it now.
The cluster only helps if DNS actually lives on the DNS nodes.
Step 5 — Add DNS-only nodes to the WHM DNS cluster
This is the heart of the setup. The primary server pushes zones out, and the DNS-only nodes serve them.
- On each DNS-only node, generate and note its remote access key in WHM:
- WHM → Cluster/Remote Access → Remote Access Key
- Copy the full key (it’s long; copy carefully).
- On the primary cPanel server, go to WHM → DNS Functions → DNS Cluster.
- Click Enable DNS Clustering if not enabled.
- Add a new cluster member:
- Cluster Member Hostname: the DNS node hostname (example:
ns1.example.net) - Remote Username:
root - Remote Access Key: paste the key from the DNS node
- DNS Role: choose a role that allows the primary server to write to the DNS node (commonly “Synchronize Changes”)
- Cluster Member Hostname: the DNS node hostname (example:
- Repeat for the second DNS-only node.
Quick diagnostic: after adding members, WHM should show both nodes as reachable. If you get connection failures, start with firewall rules.
Also confirm WHM ports are reachable only from the primary server’s IP.
Step 6 — Push existing DNS zones to the cluster
If you already host domains on the primary server, those zones must exist on both DNS nodes.
In WHM, use the DNS cluster tools to synchronize zones. Your exact option labels may vary slightly. Look for an action that syncs or pushes zones to cluster members.
Spot-check a few domains with different shapes:
- One simple brochure site
- One domain with subdomains
- One domain with email records (MX, SPF, DKIM, DMARC)
On the DNS-only node, verify the zone file exists (BIND example path):
ls -lah /var/named | head
named-checkconf
# Replace with your domain
domain=example.com
named-checkzone "$domain" /var/named/${domain}.db
If the zone filenames differ, don’t guess. Search for the domain string:
grep -R "example.com" -n /var/named 2>/dev/null | head
Step 7 — Validate authoritative answers (don’t trust browser tests)
At this point you want two outcomes:
- Each DNS node answers authoritatively for your domains
- The answers match what the primary server is publishing
From your laptop (or a third server), query each nameserver directly by IP.
# Query NS1 directly
ns1_ip=203.0.113.10
domain=example.com
dig @${ns1_ip} ${domain} A +noall +answer
dig @${ns1_ip} ${domain} NS +noall +answer
dig @${ns1_ip} www.${domain} A +noall +answer
Then repeat for NS2.
Check for:
status: NOERRORaa(authoritative answer) in the flags when you run a fulldig- Correct IPs for A/AAAA records
If results still look inconsistent around the internet, validate glue and delegation from the registrar side:
domain=yourbrand.com
dig ${domain} NS +noall +answer
dig ns1.${domain} A +noall +answer
dig +trace ${domain} NS
Step 8 — Make cPanel create new accounts with the right NS records
Once the cluster is behaving, make sure new accounts inherit the correct nameservers. In WHM:
- Confirm default nameservers in Basic WebHost Manager Setup.
- Create a test account for a throwaway domain and confirm the zone contains NS records for
ns1/ns2.
For resellers, this is where things either stay clean or get messy. If only some accounts use the cluster, you’ll get constant tickets.
It also creates inconsistent zone edits.
Step 9 — Tighten security on DNS nodes (minimum viable hardening)
DNS servers must be reachable from the public internet. Hardening needs to be deliberate.
The goal is “secure enough” without breaking resolution.
- Limit WHM access to your admin IPs. Don’t leave 2087 open globally.
- Disable recursion for the public (authoritative-only behavior). Recursive resolvers get abused for amplification. cPanel DNSOnly should be authoritative by default, but confirm your named config.
- Monitor SSH auth logs and block brute-force attempts early.
If you want a concrete SSH detection and response workflow, use SSH brute-force troubleshooting tutorial. It’s usually a faster win than adding more tooling.
If your primary cPanel server needs a broader audit, the checks in cPanel security checklist tutorial help you catch weak defaults before they turn into incidents.
Step 10 — Operational checks: zone sync, serials, and “what changed?”
The most common DNS cluster failure isn’t “DNS is down.” It’s “DNS didn’t update.”
Start troubleshooting from that assumption.
Verify zone serial increments
On each DNS node, query the SOA record and compare serials:
domain=example.com
ns1_ip=203.0.113.10
ns2_ip=203.0.113.11
dig @${ns1_ip} ${domain} SOA +noall +answer
dig @${ns2_ip} ${domain} SOA +noall +answer
If the serials stay different for more than a few minutes after a change, sync is stuck, blocked, or misconfigured.
Confirm cluster communication from the primary
- Re-check the DNS cluster member role settings in WHM.
- Confirm the remote access key didn’t change (reinstallations can do that).
- Check firewall rules between primary and DNS nodes for WHM ports.
Log locations that actually help
On cPanel servers, the logs you’ll usually want are:
/usr/local/cpanel/logs/error_log(cPanel/WHM activity)/var/log/messagesor/var/log/syslogdepending on OS- BIND logs (varies by configuration)
If you manage several servers, centralized logging saves real time during DNS incidents. This pairs well with VPS log auditing tutorial so you can search cluster events in one place.
Step 11 — TTL strategy for moving existing customer domains to your new nameservers
If you’re migrating clients to your brand nameservers, do it in two passes. That keeps rollback simple.
- 24–48 hours before cutover: lower TTLs on key records (A, AAAA, CNAME, MX) to 300 seconds on the existing DNS provider.
- Cutover window: switch the domain’s nameservers at the registrar to
ns1/ns2. - After cutover is stable: raise TTLs to 1800–3600 for steady-state (unless you expect frequent changes).
For a disciplined cutover checklist you can hand to staff, reference DNS cutover tutorial. It’s the difference between a calm migration and an avoidable fire drill.
Step 12 — Common DNS cluster mistakes (and fast fixes)
- Glue records missing or wrong: fix at registrar, then wait for TLD caches. Use
dig +traceto verify delegation. - Nameserver IP points at the web server: correct WHM nameserver IP mappings and registrar glue, then re-test authoritative answers.
- TCP/53 blocked: large DNS responses (DNSSEC, long TXT) may fail over UDP and require TCP. Open both UDP and TCP 53.
- Recursion accidentally enabled: you’ll see abuse and load spikes. Set authoritative-only behavior and restrict recursion to localhost if needed.
- Cluster sync partially configured: zones update on one node but not the other. Check cluster member roles and reachability.
Summary: the minimal “good DNS” checklist for cPanel admins
- Two DNS-only nodes serve authoritative DNS on port 53 (UDP + TCP).
- Glue records at the registrar match the DNS node IPs.
- WHM nameserver settings map NS1/NS2 to DNS-only node IPs.
- DNS cluster pushes zones from primary → both DNS nodes.
- You validate with
digagainst each nameserver IP, not just a browser tool. - WHM access is restricted; recursion is not exposed publicly.
If you want this DNS cluster to stay boring (that’s the goal), start with infrastructure that gives you consistent networking and predictable performance. A small pair of HostMyCode VPS plans works well for DNS-only nodes, and managed VPS hosting can handle routine security and maintenance for you.
FAQ
Do I need two DNS servers, or is one DNS-only node enough?
One node is still a single point of failure. Two gives you redundancy for maintenance, unexpected reboots, or a provider-level incident.
Should the cPanel server itself be a DNS cluster member?
You can keep local DNS on the cPanel server. For resilience, the authoritative nameservers should be the DNS-only nodes.
Use the cPanel box as the “source of truth” that pushes zones.
How do I confirm the world is using my new nameservers?
Run dig yourdomain.com NS from several networks, and run dig +trace yourdomain.com NS to see delegation from the TLD down to your NS records.
Will DNSSEC work with a cPanel DNS cluster?
Yes, but it adds steps: you must publish DS records at the registrar and ensure your authoritative servers serve the signed zones consistently.
If you’re new to DNSSEC, roll it out after the cluster is stable.
What’s the fastest way to troubleshoot “DNS records didn’t update”?
Check the SOA serial on each DNS node with dig @NS_IP domain SOA. If serials differ, focus on cluster sync, access keys, and firewall rules between the primary and the DNS nodes.