Bind9 named.conf 文件中存在错误。Bind 无法启动

Bind9 named.conf 文件中存在错误。Bind 无法启动

我正在尝试在 Ubuntu Server 计算机(10.04)上设置 DNS 服务器。我在 named.conf.local 中配置了一个条目来测试它,但是当尝试重新启动 bind9 时,我收到以下错误:

 * Starting domain name service... bind9                                 [fail]

因此我检查了 syslog 的输出,这就是我得到的。

May 20 18:11:13 empression-server1 named[4700]: starting BIND 9.7.0-P1 -u bind
May 20 18:11:13 empression-server1 named[4700]: built with '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc/bind' '--localstatedir=/var' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--enable-static' '--with-openssl=/usr' '--with-gssapi=/usr' '--with-gnu-ld' '--with-dlz-postgres=no' '--with-dlz-mysql=no' '--with-dlz-bdb=yes' '--with-dlz-filesystem=yes' '--with-dlz-ldap=yes' '--with-dlz-stub=yes' '--with-geoip=/usr' '--enable-ipv6' 'CFLAGS=-fno-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS='
May 20 18:11:13 empression-server1 named[4700]: adjusted limit on open files from 1024 to 1048576
May 20 18:11:13 empression-server1 named[4700]: found 4 CPUs, using 4 worker threads
May 20 18:11:13 empression-server1 named[4700]: using up to 4096 sockets
May 20 18:11:13 empression-server1 named[4700]: loading configuration from '/etc/bind/named.conf'
May 20 18:11:13 empression-server1 named[4700]: /etc/bind/named.conf:10: missing ';' before 'include'
May 20 18:11:13 empression-server1 named[4700]: loading configuration: failure
May 20 18:11:13 empression-server1 named[4700]: exiting (due to fatal error)

所以它认为默认的named.conf文件中有错误,这太荒谬了。我仔细检查了一下,并删除了一个空白行,但我不明白它是如何判断其中有错误的。请注意,在此之前我做过named.conf.local 中有一个错误,但它在 syslog 中正确显示,我已修复它,因此它报告了正确的文件。以下是 named.conf 的内容:

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

答案1

假设第 10 行是 的最后一行named.conf,那么此错误可能是由 中的最后一个选项缺少分号引起的named.conf.local

答案2

如果您在区域描述后遗漏了 named.conf.local 中的分号,则可能会发生这种情况。请尝试将其添加到右括号后,如下所示 };

相关内容