将DNS服务器作为中间服务器转发到另一个DNS服务器,该服务器为过期的记录提供服务,并在以后更新其缓存。
我试图使用unbound作为我发现的唯一具有此服务过期功能的软件。
但是,我的unbound设置的问题是,它发送多个查询并执行奇怪的操作,使自己比简单的dig或nslookup (~100 ms)更慢(~100 ms)到上游服务器(假设它的地址是22.22.22.22)。我能做些什么使行动变得更简单吗?
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发布于 2022-10-29 13:19:36
就我的目的而言(缓存和服务过期/陈旧的记录),CoreDNS似乎工作得更好,配置如下:
. {
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模仿unbound的serve-expired特性。因此,当响应过期时,它们被视为新鲜的172800秒,并立即发送给等待上游的客户端wihout。(https://coredns.io/plugins/cache/)
https://serverfault.com/questions/1114312
复制相似问题