我有一个带有debian 9拉伸的pc和一个路由器(具有openwrt的Nano r4s )和一个bind9 9的路由器。我已经在min-cache-ttl拉伸上设置了80000秒,并且当我尝试在nano pi上设置它时,它告诉我最大值可以达到90秒!这怎么可能呢?怎样才能设定更高的价值?谢谢
debian 9 (/etc/bind/named.conf.options):
options {
directory "/var/cache/bind";
listen-on-v6 { none; };
recursion yes;
allow-transfer { none; };
dump-file "/var/cache/bind/cache.db";
notify no;
allow-notify { none; };
forward only;
forwarders {
8.8.8.8;
};
//========================================================================
// 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 no;
auth-nxdomain no; # conform to RFC1035
attach-cache yes;
min-cache-ttl 86400;
max-cache-ttl 87000;
max-cache-size 1024M;
};Nano PI R4S (/etc/bind/named.conf):
options {
directory "/var/cache/bind";
dump-file "/var/cache/bind/cache.db";
listen-on-v6 { none; };
recursion yes;
allow-transfer { none; };
notify no;
allow-notify { none; };
forward only;
forwarders {
8.8.8.8;
};
auth-nxdomain no; # conform to RFC1035
dnssec-validation no;
attach-cache yes;
min-cache-ttl 80000; ## ERROR! Max is 90!
max-cache-ttl 43200;
max-cache-size 1024M;
};发布于 2022-08-05 10:46:05
如何设置更高的值?
Get绑定-9.14源代码,更改 MAX_MIN_CACHE_TTL and的值,为自己编译绑定包。
这怎么可能呢?
<#> Debian 在bind-9.13之前,Debian有自己的修补程序0003-Add-min-cache-ttl-and-min-ncache-ttl-keywords.patch,它在绑定包中添加了min-cache-ttl特性。
Obviously min-cache-ttl was >90的最大值,因为这里没有检查 https://sources.debian.org/patches/bind9/1:9.10.3.dfsg.P4-12.3+deb9u6/10_min-cache-ttl.diff/#L30
Debian使用bind-9.13删除了http://metadata.ftp-master.debian.org/changelogs/main/b/bind9/unstable_变化量g补丁,因为上游已经在该版本中移植了此功能。
OpenWRT OpenWRT直接从ISC源文件编译绑定包。这里是makefile https://github.com/openwrt/packages/blob/master/net/bind/Makefile
PKG_VERSION:=9.18.4
PKG_SOURCE_URL:= \
https://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
https://ftp.isc.org/isc/bind9/$(PKG_VERSION)在bind中,2018年11月14日添加了min-cache-ttl,并在9.13.4版本中发布了提交https://github.com/isc-projects/bind9/commit/e9a939841dcf37021aab189caee836bfb59b45dc
这里定义的min-cache-ttl最大值https://github.com/isc-projects/bind9/commit/e9a939841dcf37021aab189caee836bfb59b45dc?diff=unified#diff-d67681a4334d52b7a3e6aa8ff9a56072834cf2f4e5158cbfd4cb3b232c731bf7R24
#define MAX_MIN_CACHE_TTL 90static intervaltable intervals[] = {
...
{ "min-cache-ttl", 1, MAX_MIN_CACHE_TTL }, /* 90 secs */
...
};So在绑定中,因此在openwrt中, min-cache-ttl was的最大值从一开始总是90。
https://unix.stackexchange.com/questions/712167
复制相似问题