绑定反向查找失败

绑定反向查找失败

我已经设置了绑定服务器,但无法执行反向查找 nslookup。

配置文件如下所示。

acl "internal" {192.168.5.0/24;};

view "internal" {

    match-clients   {"internal";};
    recursion       yes;

    zone "home" {
            type    master;
            file    "master/home.db";
    };

    zone "sludge.home" {
            type    master;
            file    "master/sludge.home.db";
    };

    zone "192.168.5.in-addr.arpa" {
            type    master;
            file    "master/192.168.5.db";
    };

    zone "255.in-addr.arpa" {
            type    master;
            file    "master/255.db";
    };

    zone "0.in-addr.arpa" {
            type    master;
            file    "master/0.db";
    };

    zone "." {
            type    hint;
            file    "master/root.hint";
    };

    zone "localhost" {
            type    master;
            file    "master/localhost.db";
    };

    zone "0.0.127.in-addr.arpa" {
            type master;
            file "master/127.0.0.db";
    };
};

192.168.5.db 看起来像这样。

$TTL    4w

@ IN SOA dns.home. home. (
        2011030403 ; serial
        3h         ; refresh after 1 week
        1h         ; retry after 1 week
        1w         ; expire after 1 week
        1h )       ; negative caching TTL of 1 hour

                        IN NS   dns.home.

12                      IN PTR  dns.home.
13                      IN PTR  firewall.home.
15                      IN PTR  sludge.home.

谢谢您的帮助。

答案1

in-addr.arpa地址的八位字节顺序相反,因此区域应该是

zone "5.168.192.in-addr.arpa" {
        type    master;
        file    "master/192.168.5.db";
};

(文件名并不重要,但您可能也想在那里切换它以匹配)

请求应采用 12.5.168.192.in-addr.arpa 的形式。dig -x 192.168.5.12将自动执行此转换。

相关内容