是否可以将本地 DNS 缓存配置为在上游失败时使用陈旧记录?

Ear*_*win 5 domain-name-system linux internal-dns

我正在寻找一个代理/缓存 DNS Linux 服务器,如果它无法从上游获取更新,它能够提供陈旧(过期)的记录。
奖励点,如果它可以配置为在上游时间过长时使用陈旧记录,然后在/如果响应到达时异步更新缓存。

所需的行为与proxy_cache_use_stalenginx 指令非常相似——尽可能在上游提供新鲜的服务,在上游关闭时提供您所拥有的一切。

dnsmasq 可以强制扩展缓存记录的 TTL,但这在两个方面都失败了——客户端在上游实时获取陈旧记录,一旦扩展的 TTL 最终到期并且上游关闭——客户端什么也得不到。

小智 6

我知道unboundDNS 中有类似的功能。

来自未绑定文档

   serve-expired: <yes or no>
          If enabled, unbound attempts to serve old responses  from  cache
          with  a  TTL of 0 in the response without waiting for the actual
          resolution to finish.  The actual resolution answer ends  up  in
          the cache later on.  Default is "no".
Run Code Online (Sandbox Code Playgroud)