With the new 5.19 version, can the stale cache update be disabled

I use unbound for dns cache. How do I prevent pihole from looking for an updated upstream ip address? I'll try the new update then.

I don't understand your question. What is it you want to do (or not do)?

Edit - if you question is simply "can the stale cache option be disabled", the answer is that it is not enabled by default. Enabling the option is done via a user-initiated dnsmasq configuration option.

Your question isn't very informative, thus, lots of assumptions here.

I assume you are referring to this (from the dnsmasq man):

--use-stale-cache[=<max TTL excess in s>]
When set, if a DNS name exists in the cache, but its time-to-live has expired, dnsmasq will return the data anyway. (It attempts to refresh the data with an upstream query after returning the stale data.) This can improve speed and reliability. It comes at the expense of sometimes returning out-of-date data and less efficient cache utilisation, since old data cannot be flushed when its TTL expires, so the cache becomes mostly least-recently-used. To mitigate issues caused by massively outdated DNS replies, the maximum overaging of cached records can be specified in seconds (defaulting to not serve anything older than one day). Setting the TTL excess time to zero will serve stale cache data regardless how long it has expired.

The man says: It attempts to refresh the data with an upstream query after returning the stale data.

This behavior is the same as the unbound + cachedb (redis) module, after the reply has been sent to the client, an attempt is made to update the cached data. As far as I know, it cannot be disabled.

  • it doesn't look like use-stale-cache is currently enforced by pi-hole, see (sources) here, unless they add it (scripted) later...
  • The dnsmasq use-stale-cache setting only works if you actually have a dnsmasq cache (pihole default setting is cache-size=10000).
  • Setting the cache-size=0 will ensure old (dnsmasq) data is never used.
  • Even with cache-size=0, you may notice dnsmasq still uses cache (#define CACHESIZ 150 /* default cache size */, hardcoded in src/config.h). On the dashboard / "upstream servers" graph, click on the cached entry to see the cached items...
  • dnsmasq + DNSSEC will not work with cache-size=0.

The pi-hole developers / moderators are strongly opposed to changing the default cache-size (10000), however, I've been using it for years now (unbound + cachdb module), the consequences are mine to take (no impact on user experience). Keep in mind you will need to make the change every time you update p-ihole.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.