首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >解绑定作为缓存中间服务器是缓慢的,并且比我所需要的要做的更多。

解绑定作为缓存中间服务器是缓慢的,并且比我所需要的要做的更多。
EN

Server Fault用户
提问于 2022-10-29 11:00:34
回答 1查看 449关注 0票数 1

我需要什么

将DNS服务器作为中间服务器转发到另一个DNS服务器,该服务器为过期的记录提供服务,并在以后更新其缓存。

问题

我试图使用unbound作为我发现的唯一具有此服务过期功能的软件。

但是,我的unbound设置的问题是,它发送多个查询并执行奇怪的操作,使自己比简单的dignslookup (~100 ms)更慢(~100 ms)到上游服务器(假设它的地址是22.22.22.22)。我能做些什么使行动变得更简单吗?

/etc/unbound/unbound.conf

代码语言:javascript
复制
include-toplevel: "/etc/unbound/unbound.conf.d/*.conf"

server:
  chroot: ""
  logfile: /var/log/unbound.log
  verbosity: 2
  log-queries: yes
  port: 53
  cache-min-ttl: 600
  rrset-cache-size: 400m
  msg-cache-size: 200m
  prefetch: yes
  serve-expired: yes
  serve-expired-ttl: 172800 # :)
  do-not-query-localhost: no
  tcp-upstream: no
  outgoing-num-tcp: 4000
  incoming-num-tcp: 4000
  access-control: ... # a few access-control lines
  so-reuseport: yes
  tcp-idle-timeout: 10000
  edns-tcp-keepalive: yes

remote-control:
  control-enable: yes

forward-zone:
  name: "ir"
  forward-addr: 46.224.1.42
  forward-addr: 8.8.4.4

forward-zone:
  name: "."
  forward-addr: 22.22.22.22 # Upstream server
EN

回答 1

Server Fault用户

发布于 2022-10-29 13:19:36

就我的目的而言(缓存和服务过期/陈旧的记录),CoreDNS似乎工作得更好,配置如下:

代码语言:javascript
复制
. {
  bind lo
  forward . 22.22.22.22
  log
  cache {
    success 20000 3600 600
    denial 10000 1800 600
    prefetch 5000
    serve_stale 172800s immediate
  }
}

其中22.22.22.22是上游服务器的地址,serve_stale 172800s immediate模仿unboundserve-expired特性。因此,当响应过期时,它们被视为新鲜的172800秒,并立即发送给等待上游的客户端wihout。(https://coredns.io/plugins/cache/)

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

https://serverfault.com/questions/1114312

复制
相关文章

相似问题

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