Bind9缓存自动刷新

Bind9缓存自动刷新

我家里有一台小型服务器(Ubuntu 12.10 x64),它还充当我的 LAN 的 DNS 缓存(使用 BIND9)。我尝试查看文档,似乎没有办法对其进行配置,以便在条目过期时刷新条目而不是删除条目。目标是即使在没有请求的期间也能保持缓存温暖。

这可能吗?如果可以,怎么做?

答案1

BIND 没有你想要的功能,但是未绑定确实如此。在以下位置搜索“prefetch”文档

 prefetch: <yes or no>
       If yes, message cache elements are prefetched before they expire
       to  keep  the  cache  up to date.  Default is no.  Turning it on
       gives about 10 percent more traffic and load on the machine, but
       popular items do not expire from the cache.

答案2

这篇回复原本是这样的:

No, it's not possible with BIND.

In most cases I wouldn't think it would be particularly
useful, either, but that's up to  you (and perhaps you
regularly deal with some domain that has very poorly set
TTLs.  If you absolutely must, there is an option in BIND
that will allow you to set a minimum floor for TTLs.

我仍然怀疑在一般情况下是否有必要这样做,但人们对此功能有需求,从 BIND 9.10 开始,ISC 引入了一个新的预取选项——下面是发行说明条目从当前 9.10 开发版本 (目前为 9.10.0b1) 开始此功能:

The new "prefetch" option can improve recursive resolver
performance: when it is in use, cache records that are still
being requested by clients will automatically be refreshed
from the authoritative server before they expire, reducing or
eliminating the time window in which no answer is available
in the cache. [RT #35041] 

相关内容