Docs / Second nameserver and DNS clustering

Second nameserver and DNS clustering

A default install is one server that does everything: DNS, web, mail, databases and the panel. The panel publishes both ns1 and ns2 at that same IP. That satisfies registrars that want two names, but it is not redundancy: while the server is down, every hosted domain stops resolving. DNS clustering copies every zone to a second server, so DNS survives the first one failing. It copies DNS only. Websites, mail and the panel stay on the first server.

What you need

  • A second server with its own public IP, ideally at another provider or region. It needs only BIND, not the panel. The script uses apt-get (Debian, Ubuntu) or dnf (RHEL family) and must run as root.
  • Port 53 on UDP and TCP open to the internet on the second server, in its firewall and in the provider's cloud firewall (zone transfers use TCP). The script does not open it. The first server must be reachable on port 53 from the second; a standard install opens it. See Server firewall and Host Access and VPS provider notes.
  • The second server must reach the panel address over HTTPS, and you need to edit host records (glue) at your registrar (Registrar guide).

Set it up

  1. Open System → Clustering, card DNS clustering. Type the second server's IP in ns2 IP address and press Enable clustering. The status reads enabled → <IP>. The panel creates a shared key nimbopanel-cluster and a list of zones catalog.nimbopanel.invalid, then republishes every zone so that only that key may transfer it and the second server is notified of each change. It never contacts the second server and does not test the address, so a mistyped IP is accepted and simply receives nothing.

  2. The card now shows Run this on your ns2 box (once). Run that command as root on the second server:

    curl -fsSL https://panel.example.com/static/setup-ns2.sh -o setup-ns2.sh && sudo bash setup-ns2.sh --primary 203.0.113.10 --secret '<secret>'
    

    --primary is this server's IP. Treat the secret like a password: with it anyone can download your zones. Only administrators see it; the panel keeps it encrypted in its database, and it stays in the second server's shell history. The script installs BIND (bind9 or bind), writes the key and a secondary list to nimbopanel-cluster.conf in /etc/bind or /etc/named, adds a catalog-zones clause plus recursion no to BIND's options, checks them with named-checkconf and restarts named. Every zone then appears on the second server by itself, with no per-zone setup; copies are kept in /var/cache/bind/nimbopanel-slaves or /var/named/nimbopanel-slaves.

  3. Open port 53 on the second server (see above).

  4. Move the ns2 name to the second server, then check.

Move the ns2 name

Enabling changes no DNS record: ns2 still answers with this server's address. At the registrar of the domain your nameserver names live under, change the host record (glue) of ns2 to the second server's IP and leave ns1 alone.

  • System → Server → Nameservers compares both names with this server's IP. After the move it can show not pointing here yet, with ns2.example.com → <second IP>. That is expected.
  • The panel keeps the zone of its own nameserver domain and publishes ns2 in it as this server's address. System → Server → DNS zones lists it as Kept by the panel, with no editor. A resolver that trusts the zone's own data over your registrar's glue can therefore go on being told this server for ns2. To avoid that, give the second nameserver a name under another domain (field Second nameserver, for example ns2.another-domain.com) whose A record is published somewhere that does not depend on this server. Saving rewrites the nameserver records of every hosted zone that uses the server's pair. If your nameserver domain is a hosting account here, an ns2 A record you add in that account's zone replaces the automatic one.

Check that it works

From a third machine, with the two IPs:

dig @FIRST_IP  example.com SOA +short
dig @SECOND_IP example.com SOA +short

Both must give the same serial. Add a test domain: it should appear on the second server within a minute. For the kill test, at a quiet time stop BIND on the first server (sudo systemctl stop bind9 on Debian/Ubuntu, named on the RHEL family), check dig @SECOND_IP example.com A, then start it again.

When the first server is down

  • The second server keeps answering for every zone from its stored copy. It stops answering for a zone only after it could not reach the first server for that zone's SOA expire time: 14 days by default, 7 to 28 days if the zone sets its own.
  • Websites, mail and the panel are on the first server and stay down. You cannot change records meanwhile: the panel is down, and the second server is read-only. It catches up after the first returns, on the next notification or the zone's refresh time (one hour by default).
  • Nothing is promoted automatically; there is no failover of anything but DNS answers.

Update, disable, limits

  • Update (the button after enabling) changes the IP: transfers are allowed by key, not by address, so only the address notified changes.
  • Disable (link beside it) puts every zone back to allowing no transfers and removes the list. The second server keeps its last copies until they expire, so point ns2 back at the first server or stop named on the second.
  • One second server only. Updates and patches on it are yours to apply: it runs no panel.
  • A deleted domain can linger on the second server; sudo rndc retransfer catalog.nimbopanel.invalid there refreshes the list.
  • The script names Debian 12, Ubuntu 24.04 and AlmaLinux 9. The vendor's live failover test used two Ubuntu 24.04 servers. On the RHEL family expect to adjust BIND's options by hand (see below) and run the checks above before relying on it.

The other card on this tab, Config Cluster, is separate: it lists other Nimbopanel servers (name, panel URL and an admin API token made on that server) with their version, account count and health, with Check now and Remove. It only watches them.

Troubleshooting

  • "named-checkconf failed for the catalog-zones clause": BIND's options can conflict with what the script adds, for example a recursion line already there (the RHEL family's stock file has one). The script saved the original as /tmp/ns2-opts.bak; run named-checkconf for the first error, leave one recursion no;, and restart named.
  • dig works on the second server but times out or is refused from elsewhere: port 53 is closed (cloud firewall), or BIND answers only locally. The RHEL family's stock /etc/named.conf listens and answers only on localhost and the script does not change that: set listen-on port 53 { any; }; and allow-query { any; }; in the options block, keep recursion no;, check, restart named.
  • The first zones arrive but a new domain never does: check nc -zv FIRST_IP 53 from the second server (TCP), then retransfer as above.
  • Enable fails with dns reconfig: BIND on the first server rejected the change; the message shows its output.

Related: Point your domain (DNS) · Registrar guide · Troubleshooting