Open preethamvishy opened 11 months ago
By default unbound stores cache in memory and thus it's normal to loose cache on restart. You need cachedb as described in the unbound documentation and ofc need a seperate docker volume to store unbound cachedb or an additional redis container. If you want to change default behaviour, you would have to invest some time (especially for the 2 container version in this repo)
But LMGTFY Check if unbound has been compiled with --enable-cachedb Setup cachedb config with or without redis backend - official documentation
When the pihole-unbound container is recreated/restarted, unbound appears to be building cache from scratch and there's a high number of cache misses compared to cache hits. Since you really reap the benefits of unbound's cached DNS resolution once the cache builds up, a restart of the container for any reason appears to undo the cache built up.
Is there a way to persist the unbound cache across restarts?