<div dir="auto">Hi!<div dir="auto">Don't have the exact syntax now but you can use netmaskgrouprule with setskipcacheaction.</div><div dir="auto"><br></div><div dir="auto">Saludos</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 16, 2024, 21:28 Andreas Wili via dnsdist <<a href="mailto:dnsdist@mailman.powerdns.com">dnsdist@mailman.powerdns.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On 16.04.24 19:09, Jacob Bunk Nielsen via dnsdist wrote:<br>
> Hi<br>
> <br>
> Andreas Wili via dnsdist <<a href="mailto:dnsdist@mailman.powerdns.com" target="_blank" rel="noreferrer">dnsdist@mailman.powerdns.com</a>> writes:<br>
> <br>
>> I have dnsdist deployed centrally to route DNS queries to various backends:<br>
>> [...]<br>
>> In this setup, I use caching as follows:<br>
>> cache_all_queries = newPacketCache(2000000, {maxTTL=86400, minTTL=0,<br>
>> temporaryFailureTTL=60, staleTTL=60})<br>
>> getPool(""):setCache(cache_all_queries)<br>
>><br>
>> I would now need to disable caching for certain servers that issue a DNS query. Is there a<br>
>> rule for this or any other option?<br>
> <br>
> Do you mean that you do not want to cache responses from e.g.<br>
> "backend2"? Then you can try something like:<br>
> <br>
> -- Configure backends in separate pools<br>
> newServer({<br>
> address='192.168.100.10',<br>
> name='backend1',<br>
> pool='use_cache_pool'<br>
> })<br>
> newServer({<br>
> address='192.168.100.20',<br>
> name='backend2',<br>
> pool='no_cache_pool'<br>
> })<br>
> <br>
> -- Create cache<br>
> cache_all_queries = newPacketCache(2000000,<br>
> {maxTTL=86400,<br>
> minTTL=0,<br>
> temporaryFailureTTL=60,<br>
> staleTTL=60})<br>
> -- Set cache for the "use_cache_pool"<br>
> getPool('use_cache_pool'):setCache(cache_all_queries)<br>
> <br>
> -- route requests to your two pools, this will route ~50% to the pool<br>
> -- using cache and the remaining queries to your no_cache_pool.<br>
> -- You probably want something else, but I can't guess what.<br>
> AddAction(ProbaRule(0.5), PoolAction('use_cache_pool'))<br>
> AddAction(AllRule(), PoolAction('no_cache_pool'))<br>
> <br>
> If it's something else you wish to achieve, then please describe in more<br>
> words, e.g. with an example.<br>
> <br>
> Best regards,<br>
> Jacob<br>
> _______________________________________________<br>
> dnsdist mailing list<br>
> <a href="mailto:dnsdist@mailman.powerdns.com" target="_blank" rel="noreferrer">dnsdist@mailman.powerdns.com</a><br>
> <a href="https://mailman.powerdns.com/mailman/listinfo/dnsdist" rel="noreferrer noreferrer" target="_blank">https://mailman.powerdns.com/mailman/listinfo/dnsdist</a><br>
<br>
dnsdist has been installed on the server with the IP address<br>
192.168.100.4 and configured with the specified configuration.<br>
<br>
All other servers in the network have been configured to use this server<br>
as their resolver in /etc/resolv.conf:<br>
<br>
# /etc/resolv.conf<br>
nameserver 192.168.100.4<br>
<br>
In general, DNS resolution via dnsdist works based on the configured<br>
backends.<br>
<br>
Now, there are two servers on the network for which all DNS queries must<br>
not be cached.<br>
<br>
The question is whether a rule can be defined to exclude queries from<br>
these two servers based on their IP addresses from being cached. If<br>
caching cannot be disabled for specific source IP addresses using a<br>
rule, then the only option is to define another backend where caching is<br>
not active, right?<br>
<br>
I hope I was able to describe the issue more clearly now.<br>
<br>
Best regards,<br>
Andreas<br>
<br>
_______________________________________________<br>
dnsdist mailing list<br>
<a href="mailto:dnsdist@mailman.powerdns.com" target="_blank" rel="noreferrer">dnsdist@mailman.powerdns.com</a><br>
<a href="https://mailman.powerdns.com/mailman/listinfo/dnsdist" rel="noreferrer noreferrer" target="_blank">https://mailman.powerdns.com/mailman/listinfo/dnsdist</a><br>
</blockquote></div>