← news

What is a DNS cluster? How it works, and why hosting companies run one

A DNS cluster is a group of authoritative nameservers, typically ns1 to ns4, that all answer for the same domains and are kept in sync with wherever those domains are edited. Ask any of them about a domain in the cluster and you get the same answer.

For a hosting company, the cluster sits between two things. On one side are the web servers, where the control panel creates and edits each customer’s zone. On the other side are the nameservers the whole world queries. The cluster’s job is to move every zone from the first to the second and keep it current.

Not to be confused with

“DNS cluster” also gets used for two other things:

  • A cluster of recursive resolvers: the DNS servers your laptop or your servers ask, such as an ISP’s resolvers or a Kubernetes cluster’s internal DNS. They look names up; they aren’t the source of anyone’s zones.
  • Failover clustering of a single DNS server: two machines sharing one service and one address, where one takes over if the other dies.

This article is about the first meaning: several authoritative servers for your own domains.

How the nameservers stay in sync

The DNS protocol has had this built in for decades. One server holds the editable copy of a zone (the primary). The others (the secondaries) copy it:

  1. When the zone changes, its serial number goes up and the primary sends a NOTIFY to each secondary.
  2. Each secondary checks the serial, sees it is newer, and pulls the zone with a zone transfer: a full copy (AXFR), or only the changes (IXFR) where both sides support it.
  3. If a NOTIFY is lost, the secondary still checks on its own schedule, set by the zone’s SOA refresh timer.

For this to work, the primary must allow the secondaries to transfer the zone and must be told whom to notify. In BIND that’s allow-transfer and also-notify; in PowerDNS it’s allow-axfr-ips and also-notify. Zone transfers run over TCP port 53, not only UDP, so the firewall must allow it.

What a cluster actually buys a hosting company

  • Domains keep resolving when a web server goes down. Resolvers that get no answer from one nameserver try the next. If the nameservers are separate from the web servers, a dead web server takes its websites down, but not its DNS, so you can point records at a restored copy straight away.
  • Nameservers in more than one network and place. The long-standing advice (RFC 2182) is to spread a zone’s nameservers so that no single outage, network or location can take them all down. Many resolvers also track how fast each nameserver answers and prefer the quickest. More locations usually means quicker answers for more people, but this isn’t anycast: each nameserver is still one machine in one place.
  • One set of nameservers for every customer. Every domain points to ns1–ns4.yourbrand, whichever server hosts it. Customers set their nameservers once at the registrar and never touch them again.
  • Moving accounts without touching DNS delegation. When you move a site to another server or another panel, the domain doesn’t change nameservers. The cluster starts serving the zone from its new home, with no registrar change and no waiting for a nameserver change to spread.
  • DNS load off the web servers. Every query answered by a nameserver is one the web server doesn’t have to answer.

The part that usually breaks: the list of zones

Zone transfers keep each zone’s content in sync. They don’t tell a secondary which zones exist. Each secondary needs an entry for every zone it serves:

zone "example.com" {
    type slave;
    file "slaves/example.com.db";
    masters { 203.0.113.10; };   // the web server that owns the zone
};

On a hosting fleet, zones appear and disappear all day as accounts are created, deleted and moved. Every one of those events means editing every nameserver. Skip one, and a domain answers on ns1 but not on ns2.

There are three ways to keep that list in step:

  1. A panel’s own clustering, such as cPanel’s DNS cluster. It works well, but only between servers of that panel: the cPanel options compared.
  2. Catalog zones (RFC 9432): the primary publishes a special zone that lists the other zones, and the secondaries follow it. Modern BIND and PowerDNS support them. It only helps if every primary in your fleet can publish one.
  3. A sync layer across the fleet, which is what ZoneCloud is. An Agent on each web server reads the zones from whatever DNS server that machine runs: cPanel, Plesk, DirectAdmin, InterWorx, Virtualmin, Enhance, or plain BIND or PowerDNS. A Controller collects them and catches duplicates. Each Node is a nameserver running BIND, and it writes the type slave entries for every zone itself, then transfers the zones with standard AXFR and NOTIFY.

Where clusters go wrong in practice

In our support tickets the cluster software is rarely the problem. The trouble is usually in the DNS configuration around it:

  • The secondaries’ IPs missing from the primary’s transfer and notify lists. The zone exists, but transfers are refused; BIND logs failed while receiving responses: NOTAUTH. The fix for PowerDNS on cPanel is in the agent docs.
  • Delegation mistakes at the registrar. Glue records that don’t match the nameservers’ real IPs, or a stray NS record left in the zone. The cluster serves the zone correctly, but the world is pointed at the wrong place.
  • A nameserver listening only on IPv4. Queries that arrive over IPv6 are refused, so a domain resolves for some people and not for others.
  • The same zone defined twice. A copy in a nameserver’s own config (the default reverse zones are a classic), or an old copy on another server with a lower serial. BIND refuses to start, or the stale copy wins.
  • Transfers blocked by a firewall. Zone transfers use TCP port 53, so a firewall that only allows UDP 53 lets queries through but stops transfers.
  • DNSSEC signing modes that don’t allow transfers. cPanel’s narrow NSEC3 mode is one example: how to change it.

Getting started

If you run more than one web server and want them all on the same nameservers, start with the architecture overview and the pricing calculator. The Controller, Agents and Nodes are covered step by step in the documentation.