The slave server is simpler than the master server. It only creates the master configuration file and does not even create data files. It is synchronized. Some may ask if you want to install two virtual machines. If you want to install two machines and the computer memory is small, you won't be able to perform any operations. Here we only need to install one virtual machine, install and clone one.
I, Clone a VM
Step, and then continue to the next step.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1916213619-0.png "border =" 0 "alt =" "/>
II, Unmount bind-libs and bind-utils
[Root @ station51 ~] # Rpm-e bind-libs bind-utils
III, Configure yum Source
We do not use the Download Scheme here. Here we copy it directly from the master server. Our IP address is 172.16.58.200, but the IP address of the master server is 172.16.58.1.
[Root @ station51 yum. repos. d] # scp 172.16.58.1:/etc/yum. repos. d/server. repo ./
Root@172.16.58.1's password:
Server. repo
IV, Install bind
We also installed bind97 here. After the installation is complete, we found that many things on the master server are the same. No matter whether the master server or slave server has a directory on it, it is slaves. The following figure shows whether the master server or slave server is used. On the master server, we can see the slaves permission. The owner group is named and has read and write permissions. Under the current directory, the owner root group is named, the owner has no write permission. If we want to synchronize files from the master server to the/var/named directory of the slave server, they cannot be saved. We mentioned earlier that our regional files were not manually created but synchronized from the server. The synchronization process is synchronized from the named process. The named owner is the named user and the named group is the named group, therefore, when accessing the/var/named directory of the slave server, it is anti-question based on the named user's named group. Here we can know that it has no write permission, so we cannot put it in this directory, and it also prepares the slaves directory for us, we also put the synchronized files under this directory.
[Root @ station51 ~ ] # Yum-y install bind97 bind97-libs bind97-utile
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1916216235-1.png "border =" 0 "alt =" "/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1916214Q6-2.png "border =" 0 "alt =" "/>
Here we have two solutions: solution 1: Change the/var/named permission to writable. Solution 2: We can put the transferred files under the/var/named/slaves directory.
[Root @ station51 ~] # Ls-ld/var/named/slaves/
Drwxrwx --- 2 named 4096 Nov 17 2011/var/named/slaves/
II, Disable selinux
We have detailed steps for configuring the primary DNS server.
[Root @ station51 ~] # Setenforce 0
III, Edit configuration file
Here we need to write the configuration file step by step, you can remember more firmly. Here is a tip, because its configuration file is similar to the main configuration file, so we copied the main configuration file to modify it. Here we need to put the configuration file generated by ourselves aside and then copy it.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/191621GU-3.png "border =" 0 "alt =" "/>
VII, Edit configuration file
- options {
- directory "/var/named";
- allow-recursion { 172.16.0.0/16; };
- };
- zone "." IN {
- type hint;
- file "named.ca";
- };
-
- zone "localhost" IN {
- type master;
- file "named.localhost";
- allow-transfer { none; };
- };
-
- zone "0.0.127-in-addr.arpa" IN {
- type master;
- file "named.loopback";
- allow-transfer { none; };
- };
-
- zone "magedu.com" IN {
- type slave;
- file "slaves/magedu.com.zone";
- masters { 172.16.58.1; };
- allow-transfer { none; };
- };
-
- zone "58.16.172.in-addr.arpa" IN {
- type slave;
- file "slaves/172.16.58.zone";
- masters { 172.16.58.1; };
- allow-transfer { none; };
- };
8, Edit master configuration file
We need to edit the configuration file and process the corresponding master configuration file. First, we need to set the network segment to recursion, or use recursion yes; in this way, recursion is performed for everyone, recursion no; this does not give anyone recursion, but we still need to give our own intranet recursion. Because we set the slave server, the master server and the slave server mainly implement load balancing, so the data to be stored must be the same. In this case, the data on the server is almost the same at any time. We need to use synchronous transmission. The result in the red box in the figure is synchronous transmission.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1916213438-4.png "border =" 0 "alt =" "/>
9. Change the main region File
Because the NS record is used to mark who the DNS server is in A region, we have added an slave server. We want to add it to the region file and add A record. The content of the magedu.com. zone file is 172.16.58.zone. How to add, the content in the red box is added. 650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1916214209-5.png "border =" 0 "alt =" "/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1916211058-6.png "border =" 0 "alt =" "/>
10. Start named
Here there is an error. We can use the log information to find the error. The detailed log records the error and you can find the log if you do not know the error.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1916211139-7.png "border =" 0 "alt =" "/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1916211933-8.png "border =" 0 "alt =" "/>
11. view master server logs
In the log of our primary DNS server, we can check that the data is being synchronized. the synchronized IP address is 172.16.58.200. then we can query the DNS to see if there are synchronized files. Obviously, this is our slave server.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1916215T3-9.png "border =" 0 "alt =" "/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/191621I15-10.png "border =" 0 "alt =" "/>
This article from the "Drip Stone wear" blog, please be sure to keep this source http://lzysg172.blog.51cto.com/6624306/1174987