Deploying secondary DNS servers (slave DNS) for Plesk
Updated on
The goal is to set up one or more secondary DNS servers (slaves) automatically synchronized with a primary Plesk server (DNS master).
This architecture improves the resilience, the speed of DNS propagation, the simplicity, and the overall reliability of your hosting infrastructure.
This procedure is applied when you subscribe to the slave DNS management option through the LRob managed services offer. It gives you all the prerequisites and explains the procedure and the system in place in this context.
Prerequisites
Hardware and architecture
- A VPS with 1 to 2 vCores and 1 to 2 GB of RAM is more than enough (barring massive traffic: >1M requests/hour).
- 2 to 3 slave DNS servers are recommended for redundancy.
- Compatible with ARM64 or x86_64.
- Recommended system: Debian – stable, lightweight, widely supported.
- Each slave server must be:
- Hosted on a distinct network / provider (different subnet).
- Reachable over IPv4 and IPv6, each with a dedicated IP.
- Have a unique and correct host name (hostname).
- Have an rDNS (reverse DNS) matching its hostname.
Naming and domain
- Dedicate an infrastructure domain to your DNS servers, for example:
example.net - Declare the IPv4 and IPv6 glue records with your domain registry:
Example:ns1.example.net,ns2.example.net,ns3.example.net - Set these glue records as the DNS servers of your domain.
These records are essential for DNS resolvers to be able to reach your servers directly.
Installation on the slave DNS server
Installation example for Debian 12.
1. Installing Bind9
As root:
apt update && apt upgrade
apt install bind9 bind9-utils bind9-doc
2. named configuration (BIND9)
Let’s edit the first configuration file:
nano /etc/bind/named.conf.options
options {
directory "/var/cache/bind";
listen-on { any; };
listen-on-v6 { any; };
dnssec-validation auto; // default config
recursion no; // no resolver function
allow-query { any; }; // allow public DNS queries
allow-transfer { none; }; // no zone transfers to others
allow-new-zones yes; // required for rndc addzone
auth-nxdomain no; // RFC1035 compliance
version "none"; // hide version info
};
3. Configure rndc control
The rndc protocol allows control access on the slave DNS servers.
Edit the second configuration file:
nano /etc/bind/named.conf.local
Here, allow the IPs of your DNS master (Plesk server):
controls {
inet * port 953 allow { IPv4_PLESK; IPv6_Plesk ; 127.0.0.1; };
};
4. Retrieve the rndc key
The key is stored in /etc/bind/rndc.key.
Display and note the key, you will need it for the Plesk-side configuration.
cat /etc/bind/rndc.key
key "rndc-key" {
algorithm hmac-md5;
secret "xxxxxxxxxxxxxxxxxxxxxxxxx==";
};
5. Restart BIND (named)
Let’s restart the service to apply the configuration. Let’s also check that everything works normally.
systemctl restart named
rndc status
Repeat this operation for each slave DNS server.
Plesk-side configuration (master server)
1. Install the Slave DNS Manager extension
In the Plesk interface:
Extensions → Catalog → Slave DNS Manager → Install
2. Add your slave servers
Open Tools & Settings → Extensions → Slave DNS Manager → Settings
Add each slave server with:
- IP address: IPv4 of the master (Plesk server)
- IP address: IPv4 of the slave server
- Port (RNDC): 953
- Algorithm: hmac-sha256
- Secret key: the one retrieved from
/etc/bind/rndc.key - Server name (optional):
ns1.example.net
The extension will automatically create a local configuration for rndc.
3. Refresh and resync
On the Plesk Slave DNS management home page:
- Click Refresh
- Then Resynchronize
If everything is green: the configuration is probably correct.
How it works
Whenever a DNS zone is:
- created,
- modified,
- or deleted
on the Plesk server, the Slave DNS Manager automatically sends the following commands to each slave server:
| Action | Command executed |
|---|---|
| Creation | /usr/sbin/rndc -c slave.config addzone example.com '{ type slave; file "/var/lib/bind/example.com"; masters { <IP_Plesk>; }; };' |
| Update | /usr/sbin/rndc -c slave.config refresh example.com |
| Deletion | /usr/sbin/rndc -c slave.config delzone example.com |
🧱 Structure of a default DNS zone
When a new domain is created on the server, Plesk automatically generates a DNS zone from a default template.
This template can (and should) be adapted to your hosting infrastructure to ensure consistency, security and proper operation of services.
At LRob, the default DNS zone contains all the essential records for the web, e-mail and domain security:
| Record | Type | Value / Example | Description |
|---|---|---|---|
<domain>. |
A | <ip> |
Main IPv4 address of the site |
<domain>. |
AAAA | <ipv6> |
Main IPv6 address of the site |
<domain>. |
MX (10) | mail.<domain>. |
Mail server of the domain |
<domain>. |
TXT | v=spf1 +mx include:_spf.lrob.net -all |
SPF policy allowing sending through LRob |
<domain>. |
NS | <hostname>. |
DNS master server (Plesk) |
<domain>. |
CAA (issuewild) | letsencrypt.org |
Allows Let’s Encrypt to issue certificates |
<domain>. |
TXT | Hosted by www.lrob.fr/ | WordPress Security Expert | WordPress Security Expert` |
<domain>. |
NS | ns1.lrob.net. |
Secondary DNS server no. 1 |
<domain>. |
NS | ns2.lrob.net. |
Secondary DNS server no. 2 |
<domain>. |
NS | ns3.lrob.net. |
Secondary DNS server no. 3 |
_dmarc.<domain>. |
TXT | v=DMARC1; p=reject; sp=reject; aspf=s; rua=mailto:dmarcreport@lrob.fr; ruf=mailto:dmarcreport@lrob.fr; rf=afrf; pct=100; ri=172800 |
Strict DMARC policy for e-mail authentication |
ftp.<domain>. |
CNAME | <domain>. |
Alias for FTP |
mail.<domain>. |
A / AAAA | <ip> / <ipv6> |
Mail server pointing to the main host |
webmail.<domain>. |
CNAME | mail.<domain>. |
Alias to access webmail |
www.<domain>. |
CNAME | <domain>. |
Alias for the main site |
Notes
- This configuration ensures SPF + DMARC compliance, DNS redundancy, and Let’s Encrypt compatibility thanks to the
CAArecord. - The “Hosted by LRob”
TXTrecord adds a touch of identification and transparency. - The
NSservers must point to your declared secondary DNS servers (glue records included).
🔍 Testing and validation
Check external resolution
From any machine:
dig @ns1.example.net example.com
dig @ns2.example.net example.com