
Your sites can survive a web server outage. DNS often can’t. If your only nameserver sits on the same VPS as your hosting, a bad reboot or full disk can make every domain look “down” while the web stack is still fine.
This cPanel DNS cluster setup tutorial shows how to run dedicated nameservers with redundancy, predictable zone sync, and repeatable checks you can reuse during migrations.
The setup assumes you already manage WHM/cPanel and want DNS that doesn’t fall over when the hosting node has a bad day. You’ll run one primary cPanel/WHM server that owns the accounts, plus one or two lightweight DNS-only nodes. Done right, domains keep resolving even if the main server is offline.
What you’ll build (and what you need first)
Before you touch WHM, get the basics straight. Most cluster failures come from simple issues.
Common causes: hostname and rDNS don’t match, ports are blocked, or nobody decided where zones should be edited.
- Topology: 1 cPanel hosting server (Primary) + 2 DNS-only servers (ns1 + ns2).
- OS/stack: AlmaLinux/Rocky/CloudLinux with cPanel, using PowerDNS/BIND as provided by cPanel.
- Network: Public IPv4 (IPv6 optional), ports open for DNS (53 TCP/UDP), and cluster communications (WHM remote access).
- Domains: You’ll register custom nameservers (ns1.yourdomain.tld / ns2.yourdomain.tld) at your registrar.
If this is a fresh build, keep DNS off your busy web nodes. A small instance is usually plenty for DNS-only duty.
For isolation and more predictable performance, consider a HostMyCode VPS per nameserver node. That way DNS doesn’t compete with Apache/PHP during load spikes.
Step 1: Create DNS-only servers (sizing and baseline hardening)
DNS doesn’t need much CPU. It does need clean networking and strict firewall rules.
In 2026, a DNS-only node for small-to-mid hosting typically runs fine on 1 vCPU and 1 GB RAM. If you manage thousands of zones (or expect heavy query volume), start at 2 vCPU and 2 GB RAM.
-
Provision two servers (ns1 and ns2). Give each a stable public IP.
-
Set hostnames (example):
hostnamectl set-hostname ns1.yourdomain.tld hostnamectl set-hostname ns2.yourdomain.tld -
Confirm rDNS/PTR matches each hostname. Resolvers don’t always require this for authoritative DNS. It still prevents trust and reputation headaches later.
-
Baseline hardening: disable password SSH, use key-based login, and restrict inbound ports to the minimum (53 TCP/UDP + SSH from your admin IP).
If you want a safer admin pattern, use a bastion/jump host rather than exposing SSH broadly. (HostMyCode also publishes a practical approach for bastion access.)
Quick diagnostic on each DNS node:
# Confirm DNS ports are reachable locally
ss -lntup | egrep ':(53)\b'
# Confirm your hostname resolves to the node IP (after you add DNS later)
hostname -f
Step 2: Install cPanel in DNS-only mode
cPanel supports dedicated DNS nodes through its DNSONLY install option. You get the DNS stack plus the cluster interface, without the rest of the hosting footprint.
-
On ns1 (repeat for ns2), run:
cd /home curl -o latest -L https://securedownloads.cpanel.net/latest sh latest --dns-only -
Open WHM on each DNS node and complete initial setup. Keep the service set tight; these machines aren’t for websites.
Common pitfall: some providers block inbound UDP by default. The node “installs” cleanly, then fails real queries.
Test UDP/53 early, before you move anything important.
Step 3: Decide how zone ownership works (push vs sync)
cPanel DNS clustering can either have the primary server push zones outward or allow bidirectional sync across nodes. For most hosting teams, you want one place where edits happen.
- Recommended for most teams: Primary server is the write source. DNS-only nodes receive changes.
- Avoid unless you have a process: Multi-master editing across nodes. That’s where “why are my records different?” incidents come from.
If you have a migration coming up, keep the design boring. Fewer edit points means fewer surprises during cutover.
Related reading that pairs well with this setup: hosting migration setup guide tutorial.
Step 4: Link the cluster nodes in WHM (the actual cPanel DNS cluster setup)
Now connect your primary cPanel server to ns1 and ns2. Start from the primary WHM, then verify the relationship from each node.
-
On the primary server, go to:
- WHM → Cluster/Remote Access → DNS Cluster
-
Click Enable DNS clustering if it’s not already enabled.
-
Click Add a new server and enter ns1.yourdomain.tld.
-
Authentication method: use the recommended secure option available in your WHM build.
Modern cPanel deployments support token-based approaches. If you must use Remote Access Key, treat it like root access and rotate it if exposed.
-
Role: set ns1 and ns2 to “Synchronize Changes” (or the closest option that means primary pushes updates to them). Avoid “Standalone” unless you have a specific reason.
-
Save, then repeat for ns2.
After each node is added, stay on the DNS Cluster screen and confirm you can list zones without errors.
If the primary can’t reach a node, stop and fix it now (firewall, DNS, or auth). Don’t wait for zone drift.
Step 5: Open only the ports you need (and prove it)
DNS nodes must answer queries from the internet. WHM access, on the other hand, should be tightly scoped.
Treat this as a security task, not cleanup.
- Allow inbound: 53/tcp, 53/udp (from anywhere), and 22/tcp (from your admin IPs only).
- Allow WHM/cPanel service ports only between cluster members as required by your chosen auth method.
- Block everything else unless you have a specific operational need.
If you want a clean model for admin access, this pairs well with: SSH jump host setup guide tutorial.
Quick diagnostics from an external machine (replace IP):
# Test UDP DNS query (works even if TCP 53 is blocked by mistake)
dig @NS1_IP yourdomain.tld A +short
# Test TCP DNS (some environments require it for large responses/DNSSEC)
dig @NS1_IP yourdomain.tld A +tcp +short
# Verify port reachability
nc -zu NS1_IP 53
nc -zv NS1_IP 53
Step 6: Register custom nameservers at your domain registrar
A cluster in WHM doesn’t help if the registry still delegates to old nameservers.
If ns1/ns2 live under the same domain you’re delegating, you also need glue records at the registrar.
-
At your registrar, find Register Nameserver / Child nameservers.
-
Create:
- ns1.yourdomain.tld → NS1_IP
- ns2.yourdomain.tld → NS2_IP
-
Set your domain’s authoritative nameservers to ns1.yourdomain.tld and ns2.yourdomain.tld.
Registry updates usually land quickly, but resolver caches don’t follow a schedule. Verify delegation instead of guessing.
# Check delegation (look for ns1/ns2 in the NS set)
dig yourdomain.tld NS +trace
# Query authoritative directly
DIGOPTS="+nocmd +noall +answer +authority"
dig @ns1.yourdomain.tld yourdomain.tld NS $DIGOPTS
dig @ns2.yourdomain.tld yourdomain.tld NS $DIGOPTS
Step 7: Point WHM to your new nameservers (and bulk update accounts)
Next, make sure cPanel accounts use ns1/ns2. That way new zones, updates, and AutoSSL validation hit the correct authoritative DNS.
-
Set default nameservers:
- WHM → Server Configuration → Basic WebHost Manager® Setup
- Set Nameserver 1 and Nameserver 2 to ns1/ns2.
-
Update existing accounts if needed:
- WHM → Account Functions → Modify an Account (one-by-one), or use your preferred bulk process.
Reseller setups trip people up here. Make sure your packages and defaults point at the right nameservers. Otherwise, new accounts may inherit old values.
Step 8: Validate zone sync (create a test record and watch it replicate)
Don’t trust green status lights. Add a record, then confirm it shows up on both authoritative nodes.
-
On the primary server, add a test record in a zone. Example:
- Name:
dns-test - Type:
TXT - Value:
cluster-ok-2026 - TTL: 300
- Name:
-
Query each nameserver directly:
dig @ns1.yourdomain.tld dns-test.yourdomain.tld TXT +short dig @ns2.yourdomain.tld dns-test.yourdomain.tld TXT +short -
If one node doesn’t answer, start with firewall rules. Then check WHM cluster status. Finally, confirm the DNS service is running on the node.
Step 9: Make DNS reliable under load (timeouts, recursion, and sane limits)
Authoritative DNS should not provide recursion to the public. Open recursion turns your server into a DDoS amplifier and can get your IP space filtered.
- Authoritative-only: keep recursion disabled for public interfaces.
- Rate limits: if your DNS stack supports response rate limiting, enable it with conservative defaults.
- Monitoring: alert on DNS service down and unusual query spikes.
For lightweight monitoring that fits hosting ops, follow: VPS monitoring setup tutorial and add checks for UDP/53 and TCP/53.
Step 10: Troubleshooting checklist (the issues you’ll actually hit)
These are the problems that show up in real environments, plus the quickest places to look.
Zones don’t sync to ns1/ns2
- Check cluster status in WHM on the primary: DNS Cluster page should show reachable nodes.
- Confirm time sync across nodes (clock skew can break auth/SSL in some setups).
- Verify services are running on DNS nodes (PowerDNS/BIND as configured by cPanel).
- Firewall: allow required cluster communication ports between primary and nodes.
Public DNS queries time out
- Test UDP vs TCP: UDP blocked is common; your queries will hang.
- Confirm port 53 is open at the provider edge firewall and on-host firewall.
- Check MTU/VPN issues if you’re routing through private networks.
Registrar glue looks right, but domains still resolve to old nameservers
- Use +trace to see delegation live:
dig domain.tld NS +trace - Wait out resolver caches (or lower TTL before making changes next time).
- Confirm you changed NS at the registrar, not just inside WHM.
AutoSSL or Let’s Encrypt validations fail after moving DNS
- Check the authoritative answer directly from ns1/ns2.
- Look for stale/colliding records if you previously used other DNS providers.
If SSL is part of your migration plan, keep this handy: VPS SSL certificate migration tutorial.
Operational runbook: changes, backups, and rollback
DNS stays boring when you treat it like infrastructure, not a side effect of hosting.
Write down what changes, back it up, and keep a fast exit if something goes wrong.
- Change control: make zone edits from one place (primary WHM) unless you have a clear multi-master policy.
- Backups: keep copies of zone data on the primary and export periodically. DNS-only nodes can be rebuilt quickly, but your zones are still production data.
- Rollback: keep old nameservers available for a short overlap window if you’re migrating from a third-party DNS provider.
For backup discipline that includes restore testing, this pairs well with: VPS backup strategy tutorial.
If you’re building dedicated nameservers or replacing a fragile DNS setup, start with stable nodes and consistent network performance. A small HostMyCode VPS works well for DNS-only servers, and managed VPS hosting is a good fit if you want help with hardening, backups, and migration planning.
FAQ
Do I really need two DNS-only servers?
Yes, if uptime matters. One nameserver is a single point of failure. Two gives you redundancy for reboots, maintenance, and network faults.
Can I run DNS on the same VPS as cPanel hosting?
You can, but it’s not the resilient design. Heavy load, disk pressure, or firewall mistakes on the hosting node can take DNS down with it.
Should I use PowerDNS or BIND on cPanel?
Use what your cPanel environment is already configured for, and prioritize reliability and consistent behavior across nodes. Mixing implementations across cluster members can complicate troubleshooting.
How do I verify a record is coming from my authoritative nameservers?
Query them directly with dig @ns1.yourdomain.tld and dig @ns2.yourdomain.tld. Don’t rely on cached answers from public resolvers while testing.
What’s the quickest way to reduce downtime risk during DNS changes?
Lower TTLs at least a day before the change, validate delegation with dig +trace, and keep a rollback plan (old nameservers) for a short overlap period.
Summary: a safer DNS foundation for hosting in 2026
A dedicated DNS cluster keeps DNS as a small, dependable subsystem. Migrations get easier, unrelated hosting incidents cause fewer outages, and scaling becomes straightforward.
If you’re standardizing your stack, build DNS-only nodes early and operate them like production.
If you want a clean place to run your primary and DNS nodes, start with a HostMyCode VPS for the cluster, and move up to dedicated servers when your zone count and query volume justify it.