Secondary DNS server configuration
******************
The purpose of the secondary server: First, as a backup of the primary DNS server, the second is to share the load of the primary DNS server.
The configuration of a secondary DNS server is relatively straightforward, because its zone database files are periodically copied from the primary DNS server, so it is not necessary to manually establish them, so configuring a secondary DNS server requires only editing its master profile/etc/name.conf.
******************
On the basis of the previous configuration of the primary domain name server, we then configure a secondary domain name server:
Requirement: The IP of the secondary DNS server is 192.168.10.20, host name is Slavedns.linux.net
Take CentOS4 as an example (if it is RedHat9, the configuration is a bit different, as described in the following configuration process)
The configuration process is as follows: (because it is based on the primary domain name server that is configured above, the master profile/etc/named.conf on the primary server does not need to be modified)
① Edit the Forward zone database file for the primary name server/var/named/chroot/var/named/linux.net
$TTL 86400
@ in SOA dns.linux.net. Root.dns.linux.net. (
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In NS dns.linux.net.
In MX ten mail.linux.net.
In NS slavedns.linux.net. Add the NS records on the secondary DNS (key!) here. )
DNS in A 192.168.10.10
www in A 192.168.10.11
FTP in A 192.168.10.12
Mail in A 192.168.10.13
Slavedns in a 192.168.10.20//This adds a record of secondary DNS (key!). )
② Edit the reverse zone database file for the primary name server/var/named/chroot/var/named/back-linux
$TTL 86400
@ in SOA dns.linux.net. Root.dns.linux.net. (
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In NS dns.linux.net.
In NS slavedns.linux.net. Add the NS records on the secondary DNS (key!) here. )
Ten in PTR dns.linux.net.
One in PTR www.linux.net.
In PTR ftp.linux.net.
In PTR mail.linux.net.
In PTR slavedns.linux.net. Add the PTR record on the secondary DNS (key!) here. )
③ Edit the primary configuration file for the secondary DNS server/etc/named.conf
Zone "Linux.net" in {
Type slave; Set to secondary type
File "Slaves/linux.net"; Specifies the file name and location of the replicated zone database (the reason is "slaves/linux.net" because
Masters {192.168.10.10;}; When the secondary DNS server is configured, the secondary server automatically replicates the forward zone database files from the primary server and
}; Reverse zone database file to secondary server/var/named/chroot/var/named/slaves)
Zone "10.168.192.in-addr.arpa" in {
Type slave;
File "Slaves/back-linux"; Ditto
Masters {192.168.10.10;}; Specify the IP address of the primary server (be sure to note the writing format)
};
*******
Testing of secondary DNS servers
Method is the same as the method of testing the primary DNS server in the previous article, just modify the client file/etc/resolv.conf, with the following contents:
Search Linux.net
NameServer 192.168.10.20//test the secondary DNS server let nameserver point to its IP.
Then through the Nslookup, host, dig and other commands to test.
**********************
Here's a look at some of the different places when configuring DNS servers in RedHat9
Under RedHat9/var/named There is no chroot directory, that is, the configuration file under/var/named under RedHat9 is a real configuration file and not a link file like CentOS,
So when you configure REDHAT9 as the primary DNS server, you only need to create and edit the forward, reverse zone database files directly under/var/named under Redhat.
In the configuration of REDHAT9 as a secondary DNS server, the first to create a slaves directory under/var/named, when configured, after restarting the service, the system will automatically generate in the slaves directory with
The primary DNS server corresponds to a forward, reverse zone database file.
NOTE: If you configure REDHAT9 as a secondary DNS server without first creating the slaves directory under/var/named, or at the end of the creation, it is probably not possible to configure the success.
You can use the following methods to solve the problem:
① #ps Aux|grep named//Use this command to view the process of the DNS server
② then kill the process with the KILL command
③ finally restart service with #service named restart
If a forward, reverse zone database file is automatically generated at this time in the/var/named/slaves directory, then the configuration is successful and if not, you need to carefully troubleshoot it.
Linux-dns Services-configuration of secondary DNS servers (bottom)