A master-slave BIND9 setup provides DNS redundancy — if the primary nameserver goes down, the secondary continues serving DNS queries.
Master Server Configuration
sudo nano /etc/bind/named.conf.local
zone "yourdomain.com" {
type master;
file "/etc/bind/zones/yourdomain.com.db";
allow-transfer { SLAVE_IP; };
notify yes;
};
Create Zone File
sudo mkdir /etc/bind/zones
sudo nano /etc/bind/zones/yourdomain.com.db
$TTL 86400
@ IN SOA ns1.yourdomain.com. admin.yourdomain.com. (
2024010101 ; Serial
3600 ; Refresh
1800 ; Retry
604800 ; Expire
86400 ) ; Minimum TTL
@ IN NS ns1.yourdomain.com.
@ IN NS ns2.yourdomain.com.
@ IN A YOUR_SERVER_IP
www IN A YOUR_SERVER_IP
mail IN A YOUR_MAIL_IP
@ IN MX 10 mail.yourdomain.com.
Slave Server Configuration
zone "yourdomain.com" {
type slave;
file "/var/cache/bind/yourdomain.com.db";
masters { MASTER_IP; };
};
Restart and Test
sudo systemctl restart bind9
dig @SLAVE_IP yourdomain.com SOA
Conclusion
BIND9 master-slave setup ensures DNS high availability. Our team configures redundant DNS infrastructure for production environments.
Comments