|
今天早上在做bind实验,把本机192.168.1.8配成了一台master服务器.
同时防火墙的配置如下:
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- localhost.localdomain anywhere
ACCEPT udp -- 192.168.1.0/24 anywhere udp dpt:domain
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
配完之后用#dig domain8.example.com 来检查服务,可以得到正常的回应
然后#host station8.domain8.example.com 检查此domain中的某台主机,也可以得到正常回应
所以我想当然的认为 # host -l 列出本domain的所有主机当然也可以, 实际结果却是失败
折腾了半天,想到防火墙中只针对53端口打开了udp传输,那是否是因为host -l是用的tcp传输呢,又加了一条iptables的INPUT条件
ACCEPT tcp -- 192.168.1.0/24 anywhere tcp dpt:domain
再次尝试 #host -l domain8.example.com, 这次成功了
同时查看日志 #tail -f /var/log/messages也可以看到
Nov 3 08:38:29 station8 named[4101]: client 192.168.1.8#32794: transfer of 'domain8.example.com/IN': AXFR started
原来host -l就相当于slave从master上拖取zone文件,使用的是tcp传输, 所以防火墙中必须打开相应的协议.另外named.conf中的allow-transfer中也必须有相应的acl来允许zone文件的传输. |
|