[dnsdist] print the ip address that match a Packet Actions

Remi Gacogne remi.gacogne at powerdns.com
Tue Sep 28 09:27:55 UTC 2021


Hi Antoine,

On 9/27/21 14:00, antoine blin via dnsdist wrote:
> I'm using the rule : "addAction(MaxQPSIPRule(5), DropAction())" and I'm 
> wondering if it is possible to see, through the console API or other 
> API, the list of subnet in which rate limit rule is applied.

Not directly, I'm afraid, but you could work something out by setting a 
tag when that rule matches, then trigger a LogAction [1] and finally a 
DropAction when the tag is set. Something like (untested, but you should 
get the idea):

addAction(MaxQPSIPRule(5), SetTagAction("max-qpsip-rule", "match"))
addAction(TagRule("max-qpsip-rule", "match"), 
LogAction('/path/to/dnsdist.log'))
addAction(TagRule("max-qpsip-rule", "match"), DropAction())

Note that this works because LogAction does not stop the processing of 
subsequent rules, as most actions do.

[1]: https://dnsdist.org/rules-actions.html#LogAction

Best regards
-- 
Remi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.powerdns.com/pipermail/dnsdist/attachments/20210928/9142ea55/attachment.sig>


More information about the dnsdist mailing list