本文共 1706 字,大约阅读时间需要 5 分钟。
本地dns不能解析了,请求外部的去解析,而第一台dns不能解析(便成了转发器),再请求其他dns解析,其他dns把结果发个转发器,转发器在发给本地dns
一台能够正常解析的dns服务器,ip地址为10.18.44.51 一台dns服务器当转发器,ip地址为10.18.44.120
正常能够解析的dns服务器10.18.44.51
#vim /etc/named.confoptions { directory "/var/named";};zone "lala.com." IN { type master; file "lala.com.zone";};
#vim /var/named/lala.com.zone$TTL 86400@ IN SOA vm2.lala.com. root.lala.com ( 100000000 1M 15M 1W 1D) IN NS vm2.lala.com.vm2 IN A 10.18.44.51 #systemctl restart named
转发器10.18.44.120
#vim /etc/named.confoption { directory "/var/named"; recursion yes; forward first; forwarders { 10.18.44.51; };};zone "houzi.com." IN { type master; file "houzi.com.zone"; notify yes;}
#vim /var/named/houzi.com.zone$TTL 86400@ IN SOA vm1.houzi.com. root.houzi.com ( 100000000 1M 15M 1W 1D) IN NS vm1.houzi.com. vm1 IN A 10.18.44.120
测试转发器:10.18.44.171
#vim /etc/resolv.confnameserver 10.18.44.120#ping www.houzinan.comPING www.houzinan.com (10.18.44.210) 56(84) bytes of data.64 bytes from 10.18.44.210 (10.18.44.210): icmp_seq=1 ttl=64 time=0.693 ms64 bytes from 10.18.44.210 (10.18.44.210): icmp_seq=2 ttl=64 time=0.645 ms#ping vm1.houzi.comPING vm1.houzi.com (10.18.44.120) 56(84) bytes of data.64 bytes from 10.18.44.120 (10.18.44.120): icmp_seq=1 ttl=64 time=0.208 ms64 bytes from 10.18.44.120 (10.18.44.120): icmp_seq=2 ttl=64 time=0.372 ms
转载于:https://blog.51cto.com/13523939/2055012