一、DNS主服务器的配置 #172.25.254.20
vim /etc/named.rfc1912.zones
zone "westos.com" IN{
type master; ##dns状态位主dns
file "westos.com.zone"; ##数据文件
allow-update {none;};
allow-transfer {172.25.254.30;};
also-notify {172.25.254.30;}; ##主动通知辅助dns
};
systemctl restart named ##重启系统
![](https://i-blog.csdnimg.cn/blog_migrate/ff7f068147e493b52c20319fcf3bb0c5.png)
二、DNS的辅服务器的配置 #172.25.254.30
dnf install bind -y ##安装DNS服务
vim /etc/named.conf ##编辑修改主配置文件
listen-on port 53 { any; };
allow-query { any; };
dnssec-validation no;
vim /etc/named.rfc1912.zone ##修改配置参数
zone "westos.com" IN{
type slave; #dns状态位辅助dns
masters { 172.25.254.20; }; #主dns
file "slaves/westos.com.zone