Bind关闭递归查询

观察DNS查询日志发现一个非本地提供服务的ZONE查询,开始采取iptables禁止掉此IP,第二天又有另一IP对此ZONE查询,看来得从根本上解决这个问题。
我的bind起初设置
[quote]allow-recursion { any; };[/quote]允许递归查询

更改配置
方法一:
在options中设置
[quote]recursion yes;[/quote]
在view中设置
[quote]allow-recursion { none; };[/quote]

方法二:
在options中设置
[quote]recursion no;[/quote]

这时Bind变成迭代查询,返回根DNS信息。

[quote]
If recursion is set to 'yes' (the default) the server will always provide recursive query behaviour if requested by the client (resolver). If set to 'no' the server will only provide iterative query behaviour - normally resulting in a referral. If the answer to the query already exists in the cache it will be returned irrespective of the value of this statement. This statement essentially controls caching behaviour in the server. The allow-recursion statement and the view clauses can provide fine-grained control. This statement may be used in a view or a global options clause.
[/quote]

[url]http://www.zytrax.com/books/dns/ch7/queries.html[/url]

最后记得重新加载配置并清除缓存
[quote]
reload Reload configuration file and zones.
reload zone [class [view]]
Reload a single zone.
flush Flushes all of the server's caches.
flush [view] Flushes the server's cache for a view.
[/quote]

/byread/bin/bind/sbin/rndc reload
/byread/bin/bind/sbin/rndc flush
问题描述:远端DNS服务允许递归查询。 如果这是一台内部DNS服务器,可以忽略本次告警。 DNS服务允许递归查询时,任何人可使用它来解析第三方全称域名(FQDN),攻击者可以伪造DNS报文刷新DNS Server Cache,这存在潜在的安全风险。 解决方法:建议您采取以下措施以降低威胁: * 限制这台主机的递归查询 具体方法为: 1. 如果你使用 bind 8,可以在“named.conf”文件(缺省路径是/etc/named.conf)的“options”里使用“allow-recursion”来进行限制。 例如,您可以只允许自己本地主机以及内部主机进行递归查询,其他主机则不允许递归查询: options { allow-recursion { 192.168.196.0/24; localhost; }; }; 注意:在修改完配置文件之后,需要重新启动named。 2. 如果您使用的是Windows DNS Server,可以通过修改注册表来将其配置为非递归DNS Server。 只要将注册表中HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service\DNS\Parameters的RecursionNO的值设定为ture.默认是false。 当有合法的解析器使用DNS服务器,或其它合法的DNS服务器将这个DNS服务器作为传递服务器(forwarder)时,不应关闭递归查询,如果不能关闭递归查询,就需要进行对进行递归查询的IP地址作出限制。如果递归查询请求来自不允许的IP地址,则DNS服务器将此查询以非递归查询对待。 3. 如果使用其它版本的Name Server,请参考相应的文档。 用的是麒麟系统
最新发布
04-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值