我正在尝试在Ubuntu Server计算机上设置DNS服务器(10.04).我在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";
解决方法
假设第10行是named.conf的最后一行,那么这个错误可能是由于named.conf.local中最后一个选项缺少分号引起的.