<div dir="ltr"><div dir="ltr"><div>Hello André,</div><div><br></div><div>Then maybe share your complete configuration, or at least the output from showRules(). I'm stating the obvious here, but maybe the rule order is incorrect, causing a different rule to match before the rule you've added now.<br></div><div><br></div><div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><font color="#000000" style="font-size:12.8px"><span style="font-size:12.8px">With kind regards,</span><br style="font-size:12.8px"><span style="font-size:12.8px">Michel Otte</span></font></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>   <div dir="auto"><div>Thank you kindly for the reply Michel.</div><div><br></div><div>I've tried something like it before with no luck, however the command line arguments you offered at least moved me a step forward, as it confirms the setup.</div><div>However, the offending subdomains still resolve, example:</div><div><br></div><div># dnsdist -c</div><div>> tostring(evilDomains:check(newDNSName("<span dir="ltr"><a href="http://1e100.net" target="_blank">1e100.net</a></span>")))</div><div>true</div><div>> quit</div><div># nslookup</div><div>> server 192.168.1.2</div><div>Default server: 192.168.1.2</div><div>Address: 192.168.1.2#53</div><div>><span> </span><span dir="ltr"><a href="http://mad07s25-in-f3.1e100.net" target="_blank">mad07s25-in-f3.1e100.net</a></span></div><div>Server: 192.168.1.2</div><div>Address: 192.168.1.2#53</div><div><br></div><div>Non-authoritative answer:</div><div>Name:<span> </span><span dir="ltr"><a href="http://mad07s25-in-f3.1e100.net" target="_blank">mad07s25-in-f3.1e100.net</a></span></div><div>Address: 142.250.201.67</div><div>Name:<span> </span><span dir="ltr"><a href="http://mad07s25-in-f3.1e100.net" target="_blank">mad07s25-in-f3.1e100.net</a></span></div><div>Address: 2a00:1450:4003:811::3</div><div><br></div><div id="m_442475246130372195appendonsend" style="font-style:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"></div><div>And the lines in /etc/dnsdist/dnsdist.conf are:</div><div><br></div><div>evilDomains = newSuffixMatchNode()</div><div>evilDomains:add("<span dir="ltr"><a href="http://1e100.net" target="_blank">1e100.net</a></span>")</div><div>addAction(SuffixMatchNodeRule(evilDomains), SpoofAction("0.0.0.0"))<br><br>I tried with PoolAction but it also didn't work.</div><div>Restarted the server and even rebooted for an update.</div><div><br></div><div>Any ideas?</div><br></div><div dir="auto"><br></div> <div><br></div><div><br></div>On Wed, Jul 24, 2024 at 08:48, Michel Otte <<a href="mailto:On+Wed,+Jul+24,+2024+at+08:48,+Michel+Otte+%3C%3Ca+href=" target="_blank">michel@cybox.nl</a>> wrote:<blockquote type="cite">  <div dir="ltr"><div dir="ltr"><div>Hello André,</div><div><br></div><div>Blocking a complete suffix in dnsdist can be done with a SuffixMatchNode [1]. You can then use a SuffixMatchNodeRule [2] in a rule. For example:</div><div><br></div><div>evilDomains = newSuffixMatchNode()</div><div>evilDomains:add("<a href="http://evildomain.com" target="_blank">evildomain.com</a>")</div><div>addAction(SuffixMatchNodeRule(evilDomains), PoolAction("abuse"))</div><div><br></div><div>Now any requests that query a QNAME that ends in "<a href="http://evildomain.com" target="_blank">evildomain.com</a>" will be sent to the "abuse" pool, or any other action [3] you want.</div><div><br></div><div>And if you connect to the CLI via a client connection (dnsdist -c), you can still manage the SuffixMatchNode, for example:</div><div><br></div><div>evilDomains:remove("<a href="http://evildomain.com" target="_blank">evildomain.com</a>")</div><div>evilDomains:add("<a href="http://otherdomain.com" target="_blank">otherdomain.com</a>")</div><div>tostring(evilDomains:check(newDNSName("<a href="http://evildomain.com" target="_blank">evildomain.com</a>")))</div><div></div><div><br></div><div><div><div class="gmail_signature" dir="ltr"><div dir="ltr"><font style="font-size:12.8px" color="#000000"><span style="font-size:12.8px">With kind regards,</span><br style="font-size:12.8px"><span style="font-size:12.8px">Michel Otte</span></font><br style="font-size:12.8px;color:rgb(136,136,136)"></div><div dir="ltr"><br></div><div dir="ltr">[1]: <a href="https://dnsdist.org/reference/config.html#suffixmatchnode" target="_blank">https://dnsdist.org/reference/config.html#suffixmatchnode</a></div></div></div>[2]: <a href="https://dnsdist.org/reference/selectors.html#SuffixMatchNodeRule" target="_blank">https://dnsdist.org/reference/selectors.html#SuffixMatchNodeRule</a></div><div>[3]: <a href="https://dnsdist.org/reference/actions.html" target="_blank">https://dnsdist.org/reference/actions.html</a></div></div><br><div class="gmail_quote"><div class="gmail_attr" dir="ltr"><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div> <div dir="auto">Hello everyone,</div><div dir="auto"><br></div><div dir="auto">A tactic to thwart DNS sinkholes is not to have an A record in the domain name and then offer hundreds or more subdomains that can be reached via UDP, and if firewall blocked, via TCP. At least, it’s what I’m facing.</div><div dir="auto"><br></div><div dir="auto">It’s laborious work to identify each subdomain, add firewall rules, host entries etc to then discover its resilience on trying different variations on subdomains hinting at a wildcard setup where any is valid.</div><div dir="auto"><br></div><div dir="auto">I wanted to enquire about the possibility of a wildcard sinkhole to spoof the main domain and all of the subdomains to tackle such scenarios as I’ve didn’t get it to work</div><div dir="auto"><br></div><div dir="auto">Best regards </div><div dir="auto">André Ferreira</div></div>_______________________________________________<br>
dnsdist mailing list<br>
<a href="mailto:dnsdist@mailman.powerdns.com" target="_blank">dnsdist@mailman.powerdns.com</a><br>
<a rel="noreferrer" href="https://mailman.powerdns.com/mailman/listinfo/dnsdist" target="_blank">https://mailman.powerdns.com/mailman/listinfo/dnsdist</a><br>
</blockquote></div></div>
</blockquote></div></blockquote></div></div>