You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Debian9未装NSCD/BIND9/DNSMASQ时系统DNS缓存及文件查询

Debian 9 DNS Cache Scenario: System-Level Cache & systemd-resolved Details

Hey there! Let's walk through your questions step by step based on your Debian 9 setup (no NSCD, BIND9, or dnsmasq installed):

1. Does the system itself store DNS resolution records without those services?

Short answer: No, not by default.

Debian 9's base system (without dedicated DNS caching services like the ones you mentioned) doesn't include a built-in system-wide DNS cache. The standard C library (glibc) used by most applications doesn't handle DNS caching on its own—each application will independently query the DNS servers listed in /etc/resolv.conf every time it needs to resolve a domain.

As you noted, apps like Chrome maintain their own local caches, but these are isolated to the application and not shared at the system level.

2. Is there a system-level DNS cache file in this scenario?

Again, no. Since there's no active system-wide DNS caching service running, there's no file that stores cached DNS records at the system level. Any DNS caching happening is strictly within individual applications, not persisted or managed by the OS itself.

3. Where does systemd-resolved store its DNS resolution records?

If you have systemd-resolved enabled (it might not be active by default on Debian 9), it keeps its DNS cache in memory, not in a persistent file. That said, you can interact with and inspect the cache using these commands:

  • View cache statistics: systemd-resolve --statistics
  • Check cached records for a specific domain: resolvectl query --cache-only example.com
  • List all cached entries (if your systemd version supports it): resolvectl cache

While systemd-resolved uses files like /run/systemd/resolve/stub-resolv.conf or /run/systemd/resolve/resolv.conf to manage DNS server configurations, these don't store cached records—they just point to the servers it queries. By default, the cache isn't saved to disk across reboots; it's cleared when the service stops or the system restarts.


内容的提问来源于stack exchange,提问作者scrapy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 06:23:01