绑定 DNS 服务器无法启动

绑定 DNS 服务器无法启动

我目前正在使用 CWPPro 运行 VPS,但我的 BIND DNS 无法启动。它显示此错误。有什么想法吗?

     named.service - Berkeley Internet Name Domain (DNS)
       Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since Fri 2022-07-08 19:36:11 UTC; 7s ago
      Process: 906 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi (code=exited, status=1/FAILURE)

Jul 08 11:56:06 server.mydomain.live systemd[1]: Stopped Berkeley Internet Name Domain (DNS).
Jul 08 19:36:11 server.mydomain.live systemd[1]: Starting Berkeley Internet Name Domain (DNS)...
Jul 08 19:36:11 server.mydomain.live bash[906]: /etc/named.conf:34: unknown option 'recursion'
Jul 08 19:36:11 server.mydomain.live bash[906]: /etc/named.conf:36: unknown option 'dnssec-enable'
Jul 08 19:36:11 server.mydomain.live bash[906]: /etc/named.conf:37: unknown option 'dnssec-validation'
Jul 08 19:36:11 server.mydomain.live bash[906]: /etc/named.conf:40: unknown option 'bindkeys-file'
Jul 08 19:36:11 server.mydomain.live bash[906]: /etc/named.conf:42: unknown option 'managed-keys-directory'
Jul 08 19:36:11 server.mydomain.live bash[906]: /etc/named.conf:44: unknown option 'pid-file'
Jul 08 19:36:11 server.mydomain.live bash[906]: /etc/named.conf:45: unknown option 'session-keyfile'
Jul 08 19:36:11 server.mydomain.live systemd[1]: named.service: control process exited, code=exited status=1
Jul 08 19:36:11 server.mydomain.live systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Jul 08 19:36:11 server.mydomain.live systemd[1]: Unit named.service entered failed state.
Jul 08 19:36:11 server.mydomain.live systemd[1]: named.service failed.


//This is my named.conf file
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a any DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html

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";
    recursing-file  "/var/named/data/named.recursing";
    secroots-file   "/var/named/data/named.secroots";
    allow-query     { any; };
};

    /* 
     - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
     - If you are building a RECURSIVE (caching) DNS server, you need to enable 
       recursion. 
     - If your recursive DNS server has a public IP address, you MUST enable access 
       control to limit queries to your legitimate users. Failing to do so will
       cause your server to become part of large scale DNS amplification 
       attacks. Implementing BCP38 within your network would greatly
       reduce such attack surface 
    */
    recursion no;

    dnssec-enable yes;
    dnssec-validation yes;

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

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

    pid-file "/run/named/named.pid";
    session-keyfile "/run/named/session.key";
};

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 server.mydomain.live
zone "server.mydomain.live" {type master; file "/var/named/server.mydomain.live.db";};
// zone_end server.mydomain.live

zone "ns1.mydomain.live" {type master;file "/var/named/ns1.mydomain.live.db";};
zone "ns2.mydomain.live" {type master;file "/var/named/ns2.mydomain.live.db";};


// zone mydomain2.co.uk
zone "mydomain2.co.uk" {type master; file "/var/named/mydomain2.co.uk.db";};
// zone_end mydomain2.co.uk

答案1

您似乎在选项}后面有多余的右括号allow-query

相关内容