[dnsdist] Enabling cache for certain sources?

Jacob Bunk Nielsen jacob at bunknielsen.dk
Sat Apr 20 17:59:31 UTC 2024


Fredrik Pettai via dnsdist <dnsdist at mailman.powerdns.com> writes:

>> addAction(NetmaskGroupRule(no_cache_ips, true), SetSkipCacheAction())
>
> Slightly OT, I wonder if it would be possible to reverse the suggested solution,
>  to cache only queries from specific IPs and skip the caching "for the rest” ?

You can just do something like this:

cache_ips = newNMG()
 
-- IPs of clients that should use the cache
cache_ips:addMask('192.0.2.1/32')
cache_ips:addMask('192.0.2.8/32')
 
addAction(NotRule(NetmaskGroupRule(cache_ips, true)), SetSkipCacheAction())

Best regards,
Jacob



More information about the dnsdist mailing list