首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >bind9配置文件问题

bind9配置文件问题
EN

Unix & Linux用户
提问于 2022-08-02 17:42:09
回答 1查看 218关注 0票数 0

我有一个带有debian 9拉伸的pc和一个路由器(具有openwrt的Nano r4s )和一个bind9 9的路由器。我已经在min-cache-ttl拉伸上设置了80000秒,并且当我尝试在nano pi上设置它时,它告诉我最大值可以达到90秒!这怎么可能呢?怎样才能设定更高的价值?谢谢

debian 9 (/etc/bind/named.conf.options):

代码语言:javascript
运行
复制
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):

代码语言:javascript
运行
复制
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;
};
EN

回答 1

Unix & Linux用户

回答已采纳

发布于 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

代码语言:javascript
运行
复制
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)

也适用于绑定-9.14.2 https://github.com/openwrt/packages/commit/868f29d4ee61205e65994f67f23a02198a9dea33#diff-eb969664858d3b384948d5ecec074c7cf894444a8e293aebb09d21720a00f5b5

在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

代码语言:javascript
运行
复制
#define MAX_MIN_CACHE_TTL 90

https://github.com/isc-projects/bind9/commit/e9a939841dcf37021aab189caee836bfb59b45dc?diff=unified#diff-d6bb5d421804dd0a1b7bd92dcd1f76348321360d9dbf5512257c4753cc815443R972

代码语言:javascript
运行
复制
static intervaltable intervals[] = {
...
    { "min-cache-ttl", 1, MAX_MIN_CACHE_TTL },  /* 90 secs */
...
};

So在绑定中,因此在openwrt中, min-cache-ttl was的最大值从一开始总是90。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/712167

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档