BIND9 不会解析

Noa*_*oah 3 server networking dns bind 16.04

出于某种原因,当我nslookup routernslookup KLAMESERVER我的 router.Klamenick.com 或 KLAMESERVER.Klamenick.com 内部域时,它总是说:

Server:         192.168.0.2
Address:        192.168.0.2#53
** server can't find router.Klamenick.com: SERVFAIL
Run Code Online (Sandbox Code Playgroud)

我检查了我配置的所有文档,以检查我的域是否在它们之后有句点,并且确实如此。它一定是别的东西。

下面是我配置的文件:

/etc/bind/named.conf.options

options {
directory "/var/cache/bind";

// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk.  See http://www.kb.cert.org/vuls/id/800113

// If your ISP provided one or more IP addresses for stable 
// nameservers, you probably want to use them as forwarders.  
// Uncomment the following block, and insert the addresses replacing 
// the all-0's placeholder.

forwarders {
8.8.8.8;
8.8.8.4;
};

//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys.  See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;

auth-nxdomain no;    # conform to RFC1035
listen-on-v6 { any; };
};
Run Code Online (Sandbox Code Playgroud)

/etc/bind/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";

zone "Klamenick.com" {
    type master;
    file "/etc/bind/db.Klamenick.com";
    };

zone "0.168.192.in-addr.arpa" {
    type master;
    notify no;
    file "/etc/bind/db.192";
};
Run Code Online (Sandbox Code Playgroud)

/etc/bind/db.Klamenick.com

;
BIND data file for local loopback interface
;
$TTL     604800
@    IN  SOA     KLAMESERVER.Klamenick.com. root.localhost. (
              2     ; Serial
         604800     ; Refresh
          86400     ; Retry
        2419200     ; Expire
         604800 )   ; Negative Cache TTL
;
@   IN  NS  KLAMESERVER.Klamenick.com.
@   IN  A   127.0.0.1
@   IN  AAAA    ::1

; Below are A record Addresses

router  IN      A       192.168.0.1
server  IN      A       192.168.0.2

; Below are CNAME Record Addresses (Aliases) - Point to an A Record Address


server1 IN      CNAME   KLAMESERVER.Klamenick.com.
router1 IN      CNAME   router.Klamenick.com.
Run Code Online (Sandbox Code Playgroud)

/etc/bind/db.192

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@   IN  SOA KLAMESERVER.Klamenick.com. root.localhost. ((
              1     ; Serial
         604800     ; Refresh
          86400     ; Retry
        2419200     ; Expire
         604800 )   ; Negative Cache TTL
;
@   IN  NS  localhost.
1   IN  PTR router.Klamenick.com.
2   IN  PTR KLAMESERVER.Klamenick.com.
Run Code Online (Sandbox Code Playgroud)

/etc/resolv.conf

nameserver 192.168.0.2
search Klamenick.com
domain Klamenick.com
Run Code Online (Sandbox Code Playgroud)

有人知道怎么回事吗?

小智 5

我还没有研究细节,但问题出在这一行:

dnssec-validation auto;
Run Code Online (Sandbox Code Playgroud)

貌似16.04的bind9版本默认开启了dnssec-validation。切换到:

dnssec-validation no;
Run Code Online (Sandbox Code Playgroud)

应该可以解决问题。