本地网络有 BIND 9.11.5-P4-5.1+deb10u2-Debian (扩展支持版本) <id:998753c>,它作为缓存服务器工作并拥有多个域区域。
仅允许来自内部网络的递归请求,而来自外部网络的服务器必须仅响应其已知的区域。
问题在于服务器不响应来自外部网络的反向区域,而直接区域在任何网络上都可以正常工作。
# cat /var/log/named.log
...
Jul 13 08:41:08 named[14909]: client @0x7f968c0d64e0 89.209.65.11#49410 (220.X.X.109.in-addr.arpa): query (cache) '220.X.X.109.in-addr.arpa/PTR/IN' denied
...
配置
# cat /etc/bind/named.conf.options
options {
notify yes;
directory "/var/cache/bind";
allow-query { any; };
allow-recursion { LAN; };
allow-query-cache { LAN; };
allow-transfer { 172.19.0.2; };
dnssec-validation yes;
listen-on { 172.19.0.1; 109.X.X.X; };
listen-on-v6 { none; };
version "unknown";
};
# cat /etc/bind/named.conf
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
acl "LAN" {
INTERNAL_NETWORK;
localhost;
localnets;
};
zone "fibernet.X.X" {
type master;
file "/etc/bind/fibernet.X.X.zone";
};
zone "216/29.X.X.109.in-addr.arpa" {
type master;
file "/etc/bind/216_29.X.X.109.in-addr.arpa";
};
zone "128/26.X.X.188.in-addr.arpa" {
type master;
file "/etc/bind/128_26.X.X.188.in-addr.arpa";
};
:~# cat /etc/bind/216_29.X.X.109.in-addr.arpa
$ORIGIN 216/29.X.X.109.in-addr.arpa.
$TTL 21600
@ IN SOA ns1.fibernet.X.X. max.fibernet.X.X. (
2023071001
6H
2H
2W
1D)
@ NS ns1.fibernet.X.X.
@ NS ns2.fibernet.X.X.
220 PTR mail.fibernet.X.X.
218 PTR fibernet.X.X.
219 PTR bras1.fibernet.X.X.
如果我添加named.conf.options文件
allow-query { any; };
allow-query-cache { any; };
allow-recursion { any; };
反向区域开始工作,但我不需要来自外部网络的递归请求。
如何为我的任务正确配置 bind9?