我已设置了主名称服务器,现在尝试配置从属名称服务器。Bind9 似乎加载并运行良好,但我收到以下错误:
Apr 27 12:47:21 ns2 named[23563]: dumping master file: slaves/tmp-oJ5LJ1RtO4: open: file not found
这是我的 named.conf.options 文件:
options {
recursion yes;
allow-recursion { trusted; };
listen-on { 10.0.1.11; }; //this machines IP.
allow-transfer { none; };
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
forwarders {
10.0.1.12;
x.x.x.x; //keeping my ISPs nameservers private for post in askUbunutu
x.x.x.x; //
};
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
从属named.conf.local文件:
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "mycity.example.com" {
type slave;
file "slaves/db.mycity.example.com";
masters { 10.0.1.12; };
};
zone "1.0.10.in-addr.arpa" {
type slave;
file "slaves/db.10";
masters { 10.0.1.12; };
};
/etc/bind/slaves 的目录权限
drwxr-sr-x 2 bind bind 4096 Apr 27 09:41 slaves
知道我做错了什么吗?
答案1
文件指令与 ubuntu 上的 bind var 目录相关,默认为以下内容:
/var/缓存/绑定
除非使用选项中的目录指令进行更改,否则它会寻找以下目录来保存数据:
/var/缓存/绑定/从属
请注意,这可能是一个更好的位置,无论如何,授予 bind 对其自己的 /etc 目录的写访问权限并不理想,因为这样做允许某人以某种方式利用 bind 更安全的方式将变量数据保存在其他地方并让服务器在那里写入,从而潜在地更改您的 bind 配置。