<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
Answering myself because I've found what I'm looking for, if anybody
need this can follow this steps:<br>
<br>
- go to
<a class="moz-txt-link-freetext" href="https://github.com/mikalsande/pdns-recursor-lua/blob/master/block.lua">https://github.com/mikalsande/pdns-recursor-lua/blob/master/block.lua</a>
(opensource script);<br>
- copy/paste block.lua script above into
/etc/powerdns/block_domains.lua (or whatever name you like);<br>
- create a list of domains you want to blacklist (no
<a class="moz-txt-link-abbreviated" href="http://www.domainname.tld">www.domainname.tld</a>, just domainname.tld) in
/etc/powerdns/block.list (or whatever name you like) ;<br>
- modify /etc/powerdns/recursor.conf as below:<br>
<br>
lua-dns-script=/etc/powerdns/block_domains.lua<br>
<br>
- restart powerdns recursor with systemctl restart
pdns-recursor.service <br>
<br>
Now you can tail your syslog for specific query you want to debug,
system should answer with a class C IP address (192.0.2.1) for IPv4
and 2001:db8::1 for IPv6.<br>
<br>
Hope this can help someone. All credits to .lua develop on github.<br>
<br>
Kudos<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">Il 24/10/2023 14:19, Andrea Biancalani
ha scritto:<br>
</div>
<blockquote type="cite"
cite="mid:cf8ad06c-d45d-4b27-8aee-3a5a69e2ef74@conmet.it">
<br>
Hello everybody,
<br>
<br>
I'm using a simple PDNS Authoritative 4.8 Master/Slave + PDNS
Recursor 4.9 servers (both MySQL backend) to allow customers
query,
<br>
local postal police required to blacklist a list of domains. I've
no knowledge about lua scripting, is there any guide teaching
which is the most fast and functional way to achieve a simple
blacklist for specific domain lists?
<br>
<br>
Thanks all.
<br>
</blockquote>
<br>
<div class="moz-signature">-- <br>
Andrea Biancalani - <i>Rep. Commerciale e Tecnico</i><br>
<b>Connessioni Metropolitane srl</b><br>
Via G. Valentini, 14 - Prato (PO) - 59100<br>
Sito web: <a href="https://www.conmet.it"
class="moz-txt-link-freetext">https://www.conmet.it</a><br>
Tel. 0574 536553<br>
Fax. 0574 536554<br>
</div>
</body>
</html>