BIND9——开放式解析器

BIND9——开放式解析器

我正在运行 Ubuntu 12.04 和 bind9。我的仅缓存 DNS 服务器实际上是一个开放的 DNS 解析器,所以我正在尝试纠正这个问题。

我尝试跟随本指南

命名配置文件

// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
#include "/etc/bind/named.conf.default-zones";

named.conf.local 仅包含。

    //
    // Do any local configuration here
    //

    // Consider adding the 1918 zones here, if they are not used in your
    // organization
    //include "/etc/bind/zones.rfc1918";

命名的.conf.选项

acl "trusted" {
        127.0.0.1/32;
        X.X.192.0/20;

};

options {
        recursion no;
        additional-from-cache no;
        allow-query { none; };
        dnssec-validation auto;
        auth-nxdomain no;    # conform to RFC1035
};

view "trusted" in {
        match-clients { trusted; };
        allow-query { trusted; };
        recursion yes;
        additional-from-cache yes;
        dnssec-validation auto;
        auth-nxdomain no;    # conform to RFC1035
};

我可以毫无问题地重新启动绑定,我可以针对绑定进行查询。但是,当我测试时,我仍然是一个开放的解析器,当我查看 DNS top 时,我的所有顶级查询都来自定义范围之外的 IP。所以我知道我出了问题。

答案1

这是我使用的:

options {
    directory "/var/named/master";
    allow-recursion { 127.0.0.1; x.y.z.0/19; ...; };
    allow-transfer { 127.0.0.1; x.y.z.0/19; ...;  };

相关内容