<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Hi</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
I've configured Powerdns to block certain domain using lua..</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
The lua file the recursor.conf refers to has the below code</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
-----------------------------------------------------</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
blocked_domains=newDS()
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0"> blocked_domains:add(dofile("/etc/pdns-recursor/blocklist.lua"))</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">function preresolve(dq)</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">  if(not blocked_domains:check(dq.qname) or (dq.qtype ~= pdns.A and dq.qtype ~= pdns.AAAA)) then</div>
<div class="ContentPasted0">            return false</div>
<div class="ContentPasted0">                else</div>
<div><br class="ContentPasted0">
</div>
<div>  dq:addAnswer(pdns.A, "182.X.X.X", 60, "blockpage.co.in")<br>
</div>
<div class="ContentPasted0">return true</div>
<div class="ContentPasted0">end</div>
<div class="ContentPasted0">   end</div>
-----------------------------------------------------</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
the code references the block list file that has the below format</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
-----------------------------------------------------</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted1">
return {
<div class="ContentPasted1">"site1.tobeblocked.com",</div>
<div class="ContentPasted1">"<span style="background-color:rgb(255, 255, 255);display:inline !important">site2.tobeblocked.com</span>",</div>
<div class="ContentPasted1">"<span style="background-color:rgb(255, 255, 255);display:inline !important">site3.tobeblocked.com</span>",</div>
<div>}</div>
<div>--------------------------------------------------<br>
</div>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted1">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Is there a way I can </span><span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); font-size: 12pt; display: inline !important;" class="ContentPasted2">populate
 the blocklist file it with the list of domains that I want to block, one domain per line, instead of the other extra characters that i need to type, I just want to avoid syntax errors when updating the file.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted1">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); font-size: 12pt; display: inline !important;" class="ContentPasted2"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted1">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); font-size: 12pt; display: inline !important;" class="ContentPasted2"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted1">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); font-size: 12pt; display: inline !important;" class="ContentPasted2">Thanks </span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted1">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); font-size: 12pt; display: inline !important;" class="ContentPasted2"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted1">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); font-size: 12pt; display: inline !important;" class="ContentPasted2">Clifford</span></div>
<br>
NOTICE: This message contains privileged and confidential information intended only for the use of the addressee named above. If you are not the intended recipient of this message you are hereby notified that you must not disseminate, copy or take any action
 in reliance on it. If you have received this message in error please notify Microscan Infocommtech Pvt. Ltd. immediately. Any views expressed in this message are those of the individual sender, except where the sender has the authority to issue and specifically
 states them. Tel - 022-66870600 Fax - 022-66870800
</body>
</html>