You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My understanding is that the cachedb module is used as a second-level cache: when a record is not in the in-memory cache, Unbound will try to fetch it from the cachedb module before resorting to the iterator module.
When clearing an entry from the cache (e.g. using unbound-control flush), the desired record is removed from the in-memory cache but kept in the cachedb chache. Then upon next request, it is fetched again from the cachedb and not processed by the iterator module. As a consequence, the cached value for the requested record is still served.
Describe the desired feature
When using the cachedb module, use of the unbound-control flush* commands shall delete requested entries from both the in-memory and cachedb caches.
An alternative would be to manually delete also the related entries in the cachedb storage (Redis-like in my case), but this would require :
to know which entries have been removed from the in-memory cache (there might be several of those, potentially a large number with e.g. flush_zone)
Clearing entries from the cache is a rather regular operation that operators of DNS resolvers have to perform when dealing with users that poorly managed their TTL during a DNS migration or that face an emergency situation.
System:
Unbound version: 1.19.2 (backported to Debian 12 from Debian Salsa)
Indeed, this is a very practical requirement. Additionally, I am planning to seek an automated method to efficiently delete specific domain entries from the unbound cache or from the records in a Redis cache. In my DNS service application, I use unbound as an upstream server. I am concerned that if my DNS service application uses command-line calls to unbound-control, it might lead to significant process overhead, potentially resulting in reduced efficiency.
The commit adds the command flush +c www.example.com and the +c option makes it remove the message also out of the cachedb. Also for flush_type, flush_zone, flush_bogus and flush_negative. For the zone, bogus and negative commands, it flushes the names that are found in the local cache from the cachedb. That should stop it from immediately serving the same data from cachedb. Without the option the commands act as before, so that the server cache can be wiped without interfering with cachedb cache contents, if desired.
Current behavior
My understanding is that the
cachedb
module is used as a second-level cache: when a record is not in the in-memory cache, Unbound will try to fetch it from thecachedb
module before resorting to theiterator
module.When clearing an entry from the cache (e.g. using
unbound-control flush
), the desired record is removed from the in-memory cache but kept in thecachedb
chache. Then upon next request, it is fetched again from thecachedb
and not processed by theiterator
module. As a consequence, the cached value for the requested record is still served.Describe the desired feature
When using the
cachedb
module, use of theunbound-control flush*
commands shall delete requested entries from both the in-memory andcachedb
caches.An alternative would be to manually delete also the related entries in the
cachedb
storage (Redis-like in my case), but this would require :flush_zone
)Neither solution seems practically achievable.
Potential use-case
Clearing entries from the cache is a rather regular operation that operators of DNS resolvers have to perform when dealing with users that poorly managed their TTL during a DNS migration or that face an emergency situation.
System:
1.19.2
(backported to Debian 12 from Debian Salsa)unbound -V
output:Additional information
Below are relevant parts of the Unbound configuration:
The text was updated successfully, but these errors were encountered: