我正在使用另一个 dns 解析器,blocky
并将其与systemd-resolved
. blocky
已经具有缓存和预取等功能。所以我不想systemd-resolved
运行缓存并弄乱blocky
' 的预取。但是如何禁用 systemd-resolved 的“缓存”?
配置文件:
/etc/systemd/resolved.conf.d/dns.conf
[Resolve]
#blocky
DNS=127.0.0.10
DNSSEC=yes
# how to disable cache?
cache=no
FallbackDNS=84.200.69.80 8.8.8.8 2001:1608:10:25::9249:d69b 2001:4860:4860::8844
Domains=~.
设置cache=no
没有效果。systemd-resolved
统计数据:
❯ systemd-resolve --statistics
DNSSEC supported by current servers: yes
Transactions
Current Transactions: 2
Total Transactions: 4008
Cache
Current Cache Size: 189
Cache Hits: 1044
Cache Misses: 3072
DNSSEC Verdicts
Secure: 230
Insecure: 410
Bogus: 731
Indeterminate: 0
PS:我可以直接使用blocky
但systemd-resolved
在各种网络场景下处理DNS更好。