我最近在Linux Mint 18.1上设置了Unbound以进行DNScaching以及DNScrypt。 它的工作原理,但我注意到这些页面只在很短的时间内被caching:
这是预期的行为,还是我需要设置不同的caching页面更长的时间? 这是我的Unboundconfiguration(/etc/unbound/unbound.conf):#
Unbound configuration file for Debian. # # See the unbound.conf(5) man page. # # See /usr/share/doc/unbound/examples/unbound.conf for a commented # reference config file.age # # The following line includes additional configuration files from the # /etc/unbound/unbound.conf.d directory. include: "/etc/unbound/unbound.conf.d/*.conf" server: verbosity: 1 num-threads: 4 outgoing-range: 8192 so-rcvbuf: 4m so-sndbuf: 4m so-reuseport: yes msg-cache-size: 50m msg-cache-slabs: 16 num-queries-per-thread: 4096 rrset-cache-size: 100m rrset-cache-slabs: 16 infra-cache-slabs: 16 do-ip4: yes do-ip6: no do-udp: yes do-tcp: yes do-daemonize: yes hide-identity: yes hide-version: yes harden-short-bufsize: yes harden-large-queries: yes harden-glue: yes harden-dnssec-stripped: yes harden-below-nxdomain: yes harden-referral-path: yes logfile: "/etc/unbound/unbound.log" use-caps-for-id: yes do-not-query-localhost: no prefetch: no forward-zone: name: "." forward-addr: 127.0.0.1@40
未绑定(或至less应该)将cachingTTL中指定的时间为您请求的logging的结果。
这正是我所观察到的系统,我必须手动运行。 初始请求需要14ms,后续请求需要0ms,当TTL到期时,下一个请求需要14ms。
初始请求显示300秒TTL,需要18ms
;; ANSWER SECTION: google.com. 300 IN A 172.217.20.46 ;; Query time: 18 msec ;; SERVER: 10.34.20.1#53(10.34.20.1) ;; WHEN: Sun Feb 12 20:39:30 2017 ;; MSG SIZE rcvd: 44
后续请求 – TTL正在倒计时,需要0ms
;; ANSWER SECTION: google.com. 196 IN A 172.217.20.46 ;; Query time: 0 msec ;; SERVER: 10.34.20.1#53(10.34.20.1) ;; WHEN: Sun Feb 12 20:41:14 2017 ;; MSG SIZE rcvd: 44
TTL过期,所以另一个上行请求是23ms
;; ANSWER SECTION: google.com. 300 IN A 172.217.20.46 ;; Query time: 23 msec ;; SERVER: 10.34.20.1#53(10.34.20.1) ;; WHEN: Sun Feb 12 20:44:37 2017 ;; MSG SIZE rcvd: 44