Bind关闭递归查询

观察DNS查询日志发现一个非本地提供服务的ZONE查询,开始采取iptables禁止掉此IP,第二天又有另一IP对此ZONE查询,看来得从根本上解决这个问题。 
我的bind起初设置 

引用
allow-recursion         { any; };

允许递归查询 

更改配置 
方法一: 
在options中设置 

引用
recursion               yes;


在view中设置 

引用
allow-recursion         { none; };



方法二: 
在options中设置 

引用
recursion               no;



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

引用

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. 



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

最后记得重新加载配置并清除缓存 

引用

  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. 



/byread/bin/bind/sbin/rndc reload 
/byread/bin/bind/sbin/rndc flush

posted on   剩余价值  阅读(1048)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示