Linux Beginner-dns cluster Chapter
The DNS server is generally used, in order to alleviate the pressure of the server, more use a primary DNS server, multiple secondary DNS servers, these DNS servers constitute a DNS cluster.
After the DNS master server is configured, another host is required to act as the secondary DNS server, and the following settings are required on another host that has the named service installed:
A, "vim/etc/named". Change line 11th to "Listen-on Port," ",", and change line 17th to "allow-query {any;};". As shown in.
B, "Vim/etc/named.rfc1912.zones". Edit the following in this file:
Zone "We.com" in {
Type slave;
Masters {172.25.254.102;};
File "Slaves/we.com.zone";
allow-update {none;};
};
where "type slave" is the DNS setting for the secondary DNS server. "Masters {172.25.254.102;}" is to set which is the primary DNS server. "File" Slaves/we.com.zone "" is a set of access files, must be in the "slaves" directory, the name can be set by itself.
After the above configuration is complete, the DNS is set to the secondary DNS server restart service, but after the content of the primary DNS changes, the contents of the secondary DNS will not change, which will cause the query domain name to appear different IP. DNS synchronization also needs to be followed by the following configuration.
Enter "Vim/etc/named.rfc1913.zones" on the primary DNS server to configure the file because it was previously set for bidirectional resolution, while the IP of the secondary DNS server belongs to other network segments, and if it is a network segment, edit its corresponding file. Add the following 29th line to the content: "Also-notify {172.25.254.202;};". When you are done, restart the service to complete the synchronization.
When modifying the domain name of the primary DNS server, you need not only modify its domain name and IP, but also the number before "serial", because in the process of synchronizing two DNS servers, the system does not read the contents of the entire file, but reads the number before "serial". If the numbers of the two DNS servers are the same, they are synchronized in different steps. So every modification needs to change the number before "serial".
As shown in the test, change the IP of "music.we.com" to "1.1.1.111" in the primary DNS server and change the number before "serial" from "0" to "2017080801". After the completion of the restart service on two hosts to test, you can see that has been automatically synchronized.
Linux Beginner-dns Cluster Chapter