#安装源 curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo #安装工具 yum install wget net-tools telnet tree nmap sysstat lrzsz dos2unix bind-utils -y #安装bind yum install bind -y #vim /etc/named.conf listen-on port 53 { 192.168.1.188; }; allow-query { any; }; forwarders { 192.168.1.1; }; #检查 named-checkconf #编辑区域配置文件 # vim /etc/named.rfc1912.zones zone "host.com" IN { type master; file "host.com.zone"; allow-update { 192.168.1.188; }; }; zone "od.com" IN { type master; file "od.com.zone"; allow-update { 192.168.1.188; }; }; #配置区域数据文件 #vim /var/named/host.com.zone $ORIGIN host.com. $TTL 600 ;10 minutes @ IN SOA dns.host.com. dnsadmin.host.com. ( 20191110 ; serial 10800 ; refreshI(3 hours) 900 ; retry (15 minutes ) 604800 ; expire (1 week) 86400 ; minimum (1 day) ) NS dns.host.com. $TTL 60 ; 1 minute dns A 192.168.1.188 HDSS7-11 A 192.168.1.188 HDSS7-12 A 10.4.7.12 HDSS7-21 A 10.4.7.21 HDSS7- 22 A 10.4.7.22 HDSS7-200 A 10.4.7 200 #vim /var/named/od.com.zone $ORIGIN od.com. $TTL 600 ;10 minutes @ IN SOA dns.od.com. dnsadmin.od.com. ( 2019111001 ; serial 10800 ; refreshI(3 hours) 900 ; retry (15 minutes ) 604800 ; expire (1 week) 86400 ; minimum (1 day) ) NS dns.od.com. $TTL 60 ; 1 minute dns A 192.168.1.188 #检查 named-checkconf systemctl start named
修改network中dns
DND1=192.168.1.188
修改/etc/resolv.conf