domain-name-system – 为什么我的DNS服务器没有转发?

前端之家收集整理的这篇文章主要介绍了domain-name-system – 为什么我的DNS服务器没有转发?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有这样设置绑定:
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
        listen-on port 53 { any; };
#       listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        forwarders      { 10.90.0.135; 10.90.0.174; };
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { any; };
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";


zone "appletop.local" IN {
        type master;
        file "appletop.local";
        allow-update { none; };
};

但它没有前进?

如果我只是将DNS服务器地址放在另一台机器上的resolv.conf中,我会得到正确的查找,因此DNS服务器必须能够为我解析,但如果我再将其他机器指向此处,则无法解析名称.

怎么了?

在MadHatter建议更改后:

现在它开始但挂在挖掘痕迹上并且不转发 – 为什么我看不到下面的转发器地址?

[root@ns1 ~]# ping www.yahoo.com
^C
[root@ns1 ~]# cd /etc/
[root@ns1 etc]# cp named.conf named.conf.last
[root@ns1 etc]# vi named.conf
[root@ns1 etc]# /etc/init.d/named reload
Reloading named-sdb:                                       [  OK  ]
[root@ns1 etc]# service named stop
Stopping named: .                                          [  OK  ]
[root@ns1 etc]# /etc/init.d/named start
Starting named:                                            [  OK  ]
[root@ns1 etc]# nslookup www.yahoo.com
;; connection timed out; trying next origin
Server:         10.138.10.30
Address:        10.138.10.30#53

** server can't find www.yahoo.com: NXDOMAIN

并挖掘跟踪:

[root@ns1 etc]# dig +trace www.yahoo.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.0.2.el6_4.6 <<>> +trace www.yahoo.com
;; global options: +cmd
.                       518400  IN      NS      E.ROOT-SERVERS.NET.
.                       518400  IN      NS      M.ROOT-SERVERS.NET.
.                       518400  IN      NS      I.ROOT-SERVERS.NET.
.                       518400  IN      NS      F.ROOT-SERVERS.NET.
.                       518400  IN      NS      G.ROOT-SERVERS.NET.
.                       518400  IN      NS      K.ROOT-SERVERS.NET.
.                       518400  IN      NS      B.ROOT-SERVERS.NET.
.                       518400  IN      NS      A.ROOT-SERVERS.NET.
.                       518400  IN      NS      C.ROOT-SERVERS.NET.
.                       518400  IN      NS      L.ROOT-SERVERS.NET.
.                       518400  IN      NS      J.ROOT-SERVERS.NET.
.                       518400  IN      NS      H.ROOT-SERVERS.NET.
.                       518400  IN      NS      D.ROOT-SERVERS.NET.

我的整个文件现在看起来像这样 – 什么不对?

options {
         listen-on port 53 { any; };
 #       listen-on-v6 port 53 { ::1; };
         directory       "/var/named";
         dump-file       "/var/named/data/cache_dump.db";
         statistics-file "/var/named/data/named_stats.txt";
         memstatistics-file "/var/named/data/named_mem_stats.txt";
         allow-query     { any; };
         recursion yes;

         dnssec-enable yes;
         dnssec-validation yes;
         dnssec-lookaside auto;

         /* Path to ISC DLV key */
         bindkeys-file "/etc/named.iscdlv.key";

         managed-keys-directory "/var/named/dynamic"; };

 logging {
         channel default_debug {
                 file "data/named.run";
                 severity dynamic;
         }; };

 zone "." IN {
         type forward;
         forward first;
         forwarders { 10.90.0.135;
                      10.90.0.174;
                    } ; };

 include "/etc/named.rfc1912.zones"; include "/etc/named.root.key";


 zone "appletop.local" IN {
         type master;
         file "appletop.local";
         allow-update { none; }; };

解决方法

你告诉它使用什么转发器,但不知道何时使用它们.如果你想让它用于一切,而不是
zone "." IN {
        type hint;
        file "named.ca";
};

尝试

zone "." {
        type forward;
        forward first;
        forwarders { 10.90.0.135;
                     10.90.0.174;
                   } ;
} ;

编辑:好的,请尝试上面的代码.我不明白你的意思是“先尝试在当地解决”,但是;你说你希望它转发.

原文链接:https://www.f2er.com/html/228188.html

猜你在找的HTML相关文章