我在FreeBSD 10桌面上使用Unbound作为本地DNS缓存解析器,但是,我不知道如何在其配置文件中为“cache-min-ttl”确定正确的值。我在Google上搜索过,但似乎没有明确的答案。目前,1800是我的选择但不确定。这是我的配置文件Unbound:
server:
interface: 0.0.0.0
verbosity: 1
cache-min-ttl: 1800
logfile: /var/unbound/unbound.log
pidfile: /var/run/local_unbound.pid
forward-zone:
name: "."
forward-addr: 114.114.114.114 # 114 DNS
forward-addr: 114.114.115.115 # 114 DNS
forward-addr: 8.8.8.8 # Google Public DNS
forward-addr: 8.8.4.4 # Google Public DNS
forward-addr: 199.85.126.10 # Norton DNS
forward-addr: 199.85.127.10 # Norton DNS
答案 0 :(得分:1)
对于桌面,您不需要自己编写配置文件。脚本local-unbound-setup
将自动为您执行此操作。自动生成的设置如下所示:
# Generated by local-unbound-setup
server:
username: unbound
directory: /var/unbound
chroot: /var/unbound
pidfile: /var/run/local_unbound.pid
auto-trust-anchor-file: /var/unbound/root.key
(resolv.conf
中的姓名服务器将添加到/var/unbound/forward.conf
。请参阅/usr/sbin/local-unbound-setup
。
这意味着cache-min-ttl
保持默认值,根据unbound.conf(5)手册页,该值为零;
cache-min-ttl: <seconds>
Time to live minimum for RRsets and messages in the cache.
Default is 0. If the the minimum kicks in, the data is cached
for longer than the domain owner intended, and thus less queries
are made to look up the data. Zero makes sure the data in the
cache is as the domain owner intended, higher values, especially
more than an hour or so, can lead to trouble as the data in the
cache does not match up with the actual data any more.