DNS reverse resolution and master-slave domain name server

DNS reverse resolution and master-slave domain name server

1. DNS reverse resolution

1. Modify the main configuration file

Enter via vim /etc/named.conf command
Insert picture description here

2. Modify zone configuration file, add reverse zone configuration

Enter via vim /etc/named.rfc1912.zones command
Insert picture description here

3. Configure the reverse zone data file

cd /var/named/
cp -p named.localhost yang.com.zone
vim /var/named/lisi.com.zone
Insert picture description here

2. Build a master-slave domain name server

1. Use the previous configuration, modify the zone configuration file of the primary domain name server, modify the reverse zone configuration, and the forward direction is the same.

Insert picture description here

2. Modify the master configuration file of the slave domain name server

yum -y install bind
vim /etc/named.conf
Insert picture description here

3. Modify the zone configuration file of the slave domain name server, add the anti zone configuration, the same is true for the positive zone.

vim /etc/named.rfc1912.zones enter the editor
Insert picture description here

4. Both the master and slave restart the service, turn off the firewall, and check whether the area data file has been downloaded successfully

systemctl restart named     重启服务 
systemctl stop firewalld     #关闭防火墙
setenforce 0
ls -l /var/named/slaves/查看区域配数据文件

5. Add the slave DNS server address in the client's domain name resolution configuration file

echo "nameserver 192.168.178.15" >> /etc/resolv.conf    添加从DNS服务器地址
echo "nameserver 192.168.178.15" >> /etc/resolv.conf    添加主DNS服务器地址

6. Test

host 192.168.178.30
nslookup 192.168.178.30

7. Stop the service of the main server and simulate the failure of the main server

systemctl stop named     停止主服务器服务
host 192.168.178.30
nslookup 192.168.178.30

Guess you like

Origin blog.csdn.net/Desire_cure_/article/details/113990844