主服务器配置脚本
#!/bin/bash
#DNS解析主服务器脚本文件
#auto by cheng at 2019.10.9
#安装服务包
yum install bind -y
修改主配置文件
sed -i '/listen-on/s/127.0.0.1/192.168.102.131/' /etc/named.conf
sed -i '/allow-query/s/localhost/any/' /etc/named.conf
#修改区域配置文件
cat >>/etc/named.rfc1912.zones <>/var/named/kgc.com.zone < /etc/resolv.conf
从服务器配置脚本
#!/bin/bash
#DNS解析从服务器脚本文件
#auto by cheng at 2019.10.9
#安装服务包
yum install bind -y
#修改主配置文件
sed -i '/listen-on/s/127.0.0.1/192.168.102.159/' /etc/named.conf
sed -i '/allow-query/s/localhost/any/' /etc/named.conf
#修改区域配置文件
cat >>/etc/named.rfc1912.zones < /etc/resolv.conf