mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-22 01:59:26 +00:00
The cache for unreachable primaries was added to BIND 9 in 2006 via 1372e172d0e0b08996376b782a9041d1e3542489. It features a 10-slot LRU array with 600 seconds (10 minutes) fixed delay. During this time, any primary with a hiccup would be blocked for the whole block duration (unless overwritten by a different entry). As this design is not very flexible (i.e. the fixed delay and the fixed amount of the slots), redesign it based on the badcache.c module, which was implemented earlier for a similar mechanism. The differences between the new code and the badcache module were large enough to create a new module instead of trying to make the badcache module universal, which could complicate the implementation. The new design implements an exponential backoff for entries which are added again soon after expiring, i.e. the next expiration happens in double the amount of time of the previous expiration, but in no more time than the defined maximum value. The initial and the maximum expiration values are hard-coded, but, if required, it should be trivial to implement configurable knobs.