Edit the /etc/named.conf file on the DNS Primary Server:
[root@dlp ~]# vi /etc/named.conf
Add the following lines to allow zone transfers to the Secondary Server (replace IP address and hostname with your own environment):
options {
listen-on port 53 { any; };
listen-on-v6 { any; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
secroots-file "/var/named/data/named.secroots";
recursing-file "/var/named/data/named.recursing";
allow-query { localhost; internal-network; };
# add secondary server to allow to transfer zone files
allow-transfer { localhost; 192.168.100.85; };
.....
.....
}
Edit the zone file for the domain on the Primary Server (/var/named/emc.world.wan), and add the Secondary Server (replace IP address and hostname):
[root@dlp ~]# vi /var/named/emc.world.wan
$TTL 86400
@ IN SOA dlp.emc.world. root.emc.world. (
# update serial if update zone file
2022011103 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
IN NS dlp.emc.world.
# add secondary server
IN NS ns.server.education.
IN A 172.16.0.82
IN MX 10 dlp.emc.world.
dlp IN A 172.16.0.82
www IN A 172.16.0.83
After making these changes, restart the BIND service on the Primary Server:
[root@dlp ~]# systemctl restart named
Edit the /etc/named.conf file on the DNS Secondary Server and add the zone information for the Primary Server's IP address:
[root@ns ~]# vi /etc/named.conf
Add the following zone configuration for the Primary Server's IP address (replace IP address):
# add target zone info
# for IP address, it's the Primary server's IP address
zone "emc.world" IN {
type slave;
masters { 172.16.0.82; };
file "slaves/emc.world.wan";
notify no;
};
Restart the BIND service on the Secondary Server:
[root@ns ~]# systemctl restart named
You should now have a DNS Secondary Server configured, and it will retrieve zone data from the Primary Server. Verify the zone file transfer by checking the /var/named/slaves directory:
[root@ns ~]# ls /var/named/slaves
emc.world.wan # zone file transferred
Please note that you should replace IP addresses and hostnames with your specific configuration.