Ubuntu 12.04:bind9 不想启动(权限被拒绝)

Ubuntu 12.04:bind9 不想启动(权限被拒绝)

我尝试启动 bind9,但没有成功。错误似乎与权限有关,但我找不到原因。

root@server:~# /etc/init.d/bind9 start

Feb 18 20:42:24 server named[2974]: zone 0.in-addr.arpa/IN: loaded serial 1

Feb 18 20:42:24 server named[2974]: zone 127.in-addr.arpa/IN: loaded serial 1

Feb 18 20:42:24 server named[2974]: zone 57.168.192.in-addr.arpa/IN: loading from master

file /etc/bind/zones/rev.57.168.192.in-addr.arpa failed: permission denied

Feb 18 20:42:24 server named[2974]: zone 57.168.192.in-addr.arpa/IN: not loaded due to errors.

以下是配置文件:

root@server:/etc/bind# cat named.conf

include "/etc/bind/named.conf.options";

include "/etc/bind/named.conf.local";

include "/etc/bind/named.conf.default-zones"

root@server:/etc/bind# cat named.conf.options

options {

    directory "/var/cache/bind";


    forwarders {

        8.8.8.8;

                4.4.4.4;

     };

    auth-nxdomain no;    # conform to RFC1035

    listen-on-v6 { any; };

};

root@server:/etc/bind# cat named.conf.local

zone "example.com" {

type master;

file "/etc/bind/zones/example.com.db";

};

zone "57.168.192.in-addr.arpa" {

type master;

file "/etc/bind/zones/rev.57.168.192.in-addr.arpa";

};

root@server:/etc/bind# cat named.conf.default-zones

// prime the server with knowledge of the root servers
zone "." {

    type hint;

    file "/etc/bind/db.root";

};

// be authoritative for the localhost forward and reverse zones, and for

// broadcast zones as per RFC 1912

zone "localhost" {

    type master;

    file "/etc/bind/db.local";

};

zone "127.in-addr.arpa" {

    type master;

    file "/etc/bind/db.127";

};

zone "0.in-addr.arpa" {

    type master;

    file "/etc/bind/db.0";

};

zone "255.in-addr.arpa" {

    type master;

    file "/etc/bind/db.255";

};


File Permissions seems to be fine

root@server:/etc/bind/zones# ls -all

-rw-r--r-- 1 root bind  675 Feb 16 22:28 example.com.db

-rw-r--r-- 1 root bind  599 Feb 16 22:15 rev.57.168.192.in-addr.arpa

Everything seems to be O.K. when I start it manually

root@server:~# named -g

18-Feb-2014 21:21:20.913 starting BIND 9.8.1-P1 -g

18-Feb-2014 21:21:21.035 zone 0.in-addr.arpa/IN: loaded serial 1

18-Feb-2014 21:21:21.035 zone 127.in-addr.arpa/IN: loaded serial 1

18-Feb-2014 21:21:21.053 zone 57.168.192.in-addr.arpa/IN: loaded serial 2

18-Feb-2014 21:21:21.054 zone 255.in-addr.arpa/IN: loaded serial 1

18-Feb-2014 21:21:21.071 zone example.com/IN: loaded serial 1

18-Feb-2014 21:21:21.072 zone localhost/IN: loaded serial 2

18-Feb-2014 21:21:21.072 managed-keys-zone ./IN: loaded serial 0

18-Feb-2014 21:21:21.072 running

任何帮助,将不胜感激

谢谢

史蒂芬

答案1

根据 DNS 指南

文件必须以 db.* 开头

例如编辑这个

zone "57.168.192.in-addr.arpa" {

type master;

file "/etc/bind/zones/rev.57.168.192.in-addr.arpa";

};

zone "57.168.192.in-addr.arpa" {

type master;

file "/etc/bind/zones/db.rev.57.168.192.in-addr.arpa";

};

并将文件 rev.57.1​​68.192.in-addr.arpa 重命名为 db.rev.57.1​​68.192.in-addr.arpa 和这个

zone "example.com" {

type master;

file "/etc/bind/zones/example.com.db";

};

应该

zone "example.com" {

type master;

file "/etc/bind/zones/db.example.com";

};

文件应命名为 db.example.com 而不是 example.com.db

你也应该有命令 sudo named-checkconf 来检查配置

相关内容