<html><head></head><body><div>Greetings,</div><div><br></div><div>We want to implement blocking of large number (3M+) of undesirable domains (adult/malware) via DNS. We have tested using PowerDNS recursor and it is working in test environment. For blocking we have use LUA dns script with domains in sqlite3 DB. Can we do same on DNSDIST as we are using it as load balancer on front of all our resolver DNS. Does DNSDIST support LUA with sqlite3 or other database.</div><div><br></div><div><br></div><div>driver = require "luasql.sqlite3"</div><div>local env = driver.sqlite3()</div><div>function preresolve ( dq )</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if dq.qtype == pdns.A then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>local con = env:connect('/var/lib/powerdns/blacklistdomains.sqlite3',READONLY)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>local sth = con:execute( string.format("SELECT 1 FROM domains WHERE name = '%s'", dq.qname ) ) </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if sth:fetch() then </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>dq:addAnswer(pdns.A, "127.0.0.1", 300)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>sth:close()</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>con:close()</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return true;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>end</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>con:close()</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>end</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return false;</div><div>end</div><div><br></div><div><br></div><div><br></div><div><span><pre>-- <br></pre><div>Regards<br><b>Jahanzeb Arshad</b><br><br></div></span></div></body></html>