,
可以通过dig命令来详细查询DNS解析过程;
};
保存退出检查语法并且重新加载服务
[root@test~]# rndc reload
serverreload successful
切换至从服务器,加入参数:allow-transfer{ none; }; 如下所示
zone”test.com” IN {
type slave;
file “slaves/test.com.zone”;
masters { 10.0.10.60; };
allow-transfer { none; }; #none表示拒绝任何主机对其获取dns数据
};
[root@test2~]# named-checkconf
[root@test2~]# rndc reload
serverreload successful
验证:
在另一台不相干的服务器仅限dig -axfr 命令来获取数据。这里新开一台虚拟机其IP为10.0.10.90
查看网络是否畅通:
[root@mode~]# ping -c 1 10.0.10.60 | head -2
PING10.0.10.60 (10.0.10.60) 56(84) bytes of data.
64bytes from 10.0.10.60: icmp_seq=1 ttl=64 time=0.500 ms
[root@mode~]# ping -c 1 10.0.10.61 | head -2
PING10.0.10.61 (10.0.10.61) 56(84) bytes of data.
64bytes from 10.0.10.61: icmp_seq=1 ttl=64 time=0.411 ms
在slave获取master数据,可以看到,可以正常获取,如下所示:
[root@test2~]# dig -t axfr test.com @10.0.10.60 | head -10
;<<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> -taxfr test.com @10.0.10.60
;;global options: +cmd
test.com. 600 IN SOA dns.test.com.admin.test.com. 20131214 7200 600 604800 21600
test.com. 600 IN NS dns.test.com.
test.com. 600 IN NS dns2.test.com.
test.com. 600 IN MX 10mail.test.com.
dns.test.com. 600 IN A 10.0.10.60
dns2.test.com. 600 IN A 10.0.10.61
ftp.test.com. 600 IN CNAME
在其他服务器上使用dig命令来解析获取master数据将会失败,证明白名单功能已经生效,加大了对服务的安全保护,,如下所示
[root@mode~]# dig -t axfr test.com @10.0.10.60
;<<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.6 <<>> -taxfr test.com @10.0.10.60
;;global options: printcmd
;Transfer failed.
本文出自 “心情依旧” 博客,请务必保留此出处
头脑心灵再加上双脚的才是推销员。