![rndc delzone {zonename} :权限被拒绝](https://linux22.com/image/672833/rndc%20delzone%20%7Bzonename%7D%20%EF%BC%9A%E6%9D%83%E9%99%90%E8%A2%AB%E6%8B%92%E7%BB%9D.png)
系统是:
Debian GNU/Linux 8.2 (jessie)
BIND 9.9.5-9+deb8u3-Debian (Extended Support Version)
命名的.conf.选项:
options {
directory "/var/cache/bind";
key-directory "/etc/bind/keys";
// 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 {
// 0.0.0.0;
// };
//========================================================================
// 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-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
dnssec-dnskey-kskonly yes;
sig-validity-interval 21 16;
inline-signing yes;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
// permit lookup of unknown dns names
recursion no;
// allow dynamicly new zones
allow-new-zones yes;
};
缓存文件/var/cache/bind/3bf305731dd26307.nzf
拥有权限 0744 且归 bind:bind 所有
一切都按预期工作,我可以添加区域、统计、加载键和所有内容 - 除了:
rndc delzone {ZoneName}
如果我触发此命令(以控制台中的 root 身份),我会得到一个rndc: 'delzone' failed: permission denied
日志中没有显示任何内容..
我真的被困在这里 - 有人知道为什么会发生这个权限错误吗?
答案1
问题是我正在修改原始缓存文件/var/cache/bind/3bf305731dd26307.nzf
。
我删除了rndc addzone
自己文件结构中的所有条目,这些条目包含在 named.conf 中。在之后rndc reload
,当条目不再位于原始缓存文件中时,无法通过 删除区域rndc delzone
。要重新获得权限,区域文件的配置字符串必须/var/cache/bind/3bf305731dd26307.nzf
当触发 a 时位于原始缓存文件中rndc reload
。看来 bind 需要这个内部文件。
因此,正如内容/var/cache/bind/3bf305731dd26307.nzf
本身所述 - 请勿手动编辑此文件,仅通过rndc
。