Caching DNS Responses
DNS Load-Balancing implements a simple but effective packet cache, not enabled by default. It is enabled per-rule, but the same cache can be shared between several rules.
- Inside a rule, choose the Cache tab
- Enable DNS Caching activate the cache for responses that matches the rule.

Max Records in memory
It Is the maximum number of entries stored in the cache.
For performance reasons the cache will pre-allocate buckets based on the maximum number of entries, so be careful to set the first parameter to a reasonable value.
Something along the lines of a dozen bytes per pre-allocated entry can be expected on 64-bit.
That does not mean that the memory is completely allocated up-front, the final memory usage depending mostly on the size of cached responses and therefore varying during the cache’s lifetime.
Assuming an average response size of 512 bytes, a cache size of 10000000 entries on a 64-bit host with 8GB of dedicated RAM would be a safe choice.
Default value of 10 000 entries handle 5MB of memory.
- Cache TTL (Max): Is the maximum lifetime of an entry in the cache
- Cache TTL (Min): Is the minimum lifetime an entry should have to be considered for insertion in the cache.
- Negative Cache TTL: Is the lifetime that will be used when a stale cache entry, Server Failure or a Refused response are returned.