如何禁用外部DNS递归?

我知道要在BIND中禁用递归查询,我需要/etc/bind/named.conf.options添加到/etc/bind/named.conf.options的options部分

 allow-transfer {"none";}; allow-recursion {"none";}; recursion no; 

以上配置是否会禁用所有DNS递归查询?

如何仅对外部网络查询禁用DNS递归并仅为内部网络保留递归?

如果我禁用递归,那么BIND将执行哪个进程来解析名称请求? 迭代还是反向?

您可以为某些客户端启用递归,并使用视图禁用其他客户端的递归,但不建议这样做,因为您将失去首先关闭递归的一些优点。 您应该使用不同的名称服务器进行递归解析和权威服务。 (如果需要,两台服务器可以在同一台机器上运行。)不过,这里是如何做到的:

 // global options apply to external clients options { recursion no; additional-from-auth no; additional-from-cache no; }; view "local" in { // view options enable recursion only for local clients match-clients { 172.16.45.80/23; 192.168.12.0/24; 127.0.0.1/8; ::1; }; recursion yes; additional-from-auth yes; additional-from-cache yes; zone "." in { type hint; file "/etc/bind/db.root"; }; // put definitions for zones like "localhost" and "127.in-addr.arpa" here } // put definitions for real authoritative zones here. 

至于你在上一句中的问题,“BIND将执行什么过程解决名称请求?迭代还是反向?”,我不明白这个问题。 配置为不提供递归服务的名称服务器将拒绝回答递归查询。