![Bind9 最小区域配置似乎不起作用](https://linux22.com/image/584220/Bind9%20%E6%9C%80%E5%B0%8F%E5%8C%BA%E5%9F%9F%E9%85%8D%E7%BD%AE%E4%BC%BC%E4%B9%8E%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我已经在 debian squeeze 上安装了 bind9。这是我的named.conf.local
文件:
options {
directory "/var/cache/bind";
auth-nxdomain no;
listen-on { any; };
listen-on-v6 { any; };
};
zone "devhub.pl" IN {
type master;
file "db.devhub";
};
这是我的区域文件:
$TTL 3h
devhub.pl. IN SOA ns1.devhub.pl. root.devhub.pl. (
2012051201 ; serial
3h ; refresh
1h ; retry
1w ; expire
1h ) ; negative caching
IN NS ns1.devhub.pl.
IN NS ns2.devhub.pl.
ns1.devhub.pl. IN A 193.93.207.231
ns2.devhub.pl. IN A 193.93.207.231
www IN CNAME devhub.pl.
named-checkconf
并named-checkzone
报告一切正常,但当我尝试设置外部 DNS 时
ns1.devhub.pl -> 193.93.207.231
ns2.devhub.pl -> 193.93.207.231
我的提供商的管理面板显示一些类似这样的错误:
dns1: ns1.devhub.pl server isn't configured for devhub.pl domain. Please contact admin...
dns2: ns2.devhub.pl server isn't configured for devhub.pl domain. Please contact admin...
我遗漏了什么?有什么建议吗?
并记录:
starting BIND 9.7.3 -u bind -t /var/jail/bind
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=' 'CPPFLAGS='
adjusted limit on open files from 1024 to 1048576
found 2 CPUs, using 2 worker threads
using up to 4096 sockets
loading configuration from '/etc/bind/named.conf'
reading built-in trusted keys from file '/etc/bind/bind.keys'
using default UDP/IPv4 port range: [1024, 65535]
using default UDP/IPv6 port range: [1024, 65535]
listening on IPv6 interfaces, port 53
binding TCP socket: address in use
listening on IPv4 interface lo, 127.0.0.1#53
binding TCP socket: address in use
listening on IPv4 interface eth0, 172.16.7.1#53
binding TCP socket: address in use
listening on IPv4 interface eth1, 193.93.207.231#53
binding TCP socket: address in use
generating session key for dynamic DNS
set up managed keys zone for view _default, file 'managed-keys.bind'
automatic empty zone: 254.169.IN-ADDR.ARPA
automatic empty zone: 2.0.192.IN-ADDR.ARPA
automatic empty zone: 100.51.198.IN-ADDR.ARPA
automatic empty zone: 113.0.203.IN-ADDR.ARPA
automatic empty zone: 255.255.255.255.IN-ADDR.ARPA
automatic empty zone: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
automatic empty zone: 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
automatic empty zone: D.F.IP6.ARPA
automatic empty zone: 8.E.F.IP6.ARPA
automatic empty zone: 9.E.F.IP6.ARPA
automatic empty zone: A.E.F.IP6.ARPA
automatic empty zone: B.E.F.IP6.ARPA
automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA
couldn't add command channel 127.0.0.1#953: address in use
couldn't add command channel ::1#953: address in use
zone 0.in-addr.arpa/IN: loaded serial 1
zone 127.in-addr.arpa/IN: loaded serial 1
zone 255.in-addr.arpa/IN: loaded serial 1
zone localhost/IN: loaded serial 2
zone devhub.pl/IN: loaded serial 2012051201
managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found
managed-keys-zone ./IN: loaded serial 0
zone devhub.pl/IN: sending notifies (serial 2012051201)
running
那这怎么办address in use
?这是问题吗?
顺便说一下 bind 是 chrooted 并且正在运行/etc/init.d/bind9 start
然后/etc/init.d/bind9 status
说could not access PID file for bind9 ... failed!
答案1
May 12 22:11:17 mango named[22583]: zone devhub.pl/IN: loading from master file db.devhub failed: file not found
指定文件的完整路径(例如:/etc/bind/master/db.devhub 是我将文件放置在其中的位置)
答案2
您是否检查过 /var/log/syslog 中的日志?
另外,看看http://wiki.debian.org/Bind9#Configuration。
最后,我的 /etc/named.conf 中有一项您没有的选项部分,如下所示:(当然,我运行的是 CentOS,而不是 Debian,但 Bind9 就是 Bind9。如果您的区域文件位于不同的目录中,您可能需要告诉它区域文件的实际路径(在选项中设置目录)。
options
{
directory "/var/named"; // the default
recursion no;
listen-on { localhost; 127.0.0.1; My Public IP Address; };
allow-transfer {My Slave DNS Server;};
};
zone "domain.com" {
type master;
file "domain.com.db";
};
当然,我的区域文件(我为其提供了很多 NS 的域)位于 /var/named/ 中。