bind9 named.conf 区域大小限制

bind9 named.conf 区域大小限制

我正在尝试在本地机器上设置一个测试环境,并尝试启动一个从 named.conf.custom 文件加载配置的 DNS 守护程序。

只要该文件的大小为 3-4 个区域,bind9 守护进程就可以正常加载,但是当我输入我需要的配置文件(例如 10000 行长)时,bind 无法启动,并且在系统日志中我发现此消息:

starting BIND 9.7.0-P1 -u bind
Jun 14 17:06:06 cibionte-pc named[9785]: 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='
Jun 14 17:06:06 cibionte-pc named[9785]: adjusted limit on open files from 1024 to 1048576
Jun 14 17:06:06 cibionte-pc named[9785]: found 1 CPU, using 1 worker thread
Jun 14 17:06:06 cibionte-pc named[9785]: using up to 4096 sockets
Jun 14 17:06:06 cibionte-pc named[9785]: loading configuration from '/etc/bind/named.conf'
Jun 14 17:06:06 cibionte-pc named[9785]: /etc/bind/named.conf.saferinternet:1: unknown option 'zone'
Jun 14 17:06:06 cibionte-pc named[9785]: loading configuration: failure
Jun 14 17:06:06 cibionte-pc named[9785]: exiting (due to fatal error)

bind9 可以加载的文件大小有限制吗?

答案1

我不知道 BIND 有任何特定限制(我在 BIND 上运行了许多 DNS 服务器,其配置文件包含数千个区域)。从错误来看,似乎后续区域语句前面的某个地方缺少分号(或者其他一些破坏配置解析过程的轻微格式错误)。

答案2

BIND 日志表明 中有错误/etc/bind/named.conf.saferinternet。如果它是唯一加载的文件,您是否确认该文件可以正确加载?

如果不是该文件,请检查之前立即加载的文件的语法是否正确(没有缺少尾随分号等)。

答案3

确保生成脚本不会写出非常非常长的行。一个常见问题是忘记换行符,并且有一个内部最大行缓冲区长度,有时会让人感到困惑。这也通常表现为第 1 行出现错误,或者任何行太长。

如果您在不同的行上写出文件,那么您可能需要从文件中粘贴几行。

相关内容