<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: tahoma;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Hi,<div><br></div><div> I did something similar ti implement RPZ like functionality before PDNS had proper RPZ support and didn't notice any significant impact that was with a list of a few thousand records we where checking and seeing a few thousand QPS.<br><br>So it'll make a bit of difference but depending on how busy your server is you probably won't notice.<br><div class="mb_sig"></div>
                                        
                                        <div>Of course your mileage may vary.</div><div><br></div><div class="mb_sig">-- <div><div>Robm</div><div>873</div><div>  "Ask not what I can do for the stupid, </div><div>         but what the stupid can do for me" - Graeme Garden</div></div></div></div><blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">On 30/11/2017 14:33:38, Mario Caruso <caruso@tiscali.com> wrote:</p>Il Thu, 30 Nov 2017 14:51:46 +0100<br>Remi Gacogne <remi.gacogne@powerdns.com> ha scritto:<br><br>> Hi Mario,<br><br>Hi Remi,<br>Thank you for the reply,<br><br>> <br>> On 11/30/2017 11:52 AM, Mario Caruso wrote:<br>> > I am trying to write a lua rule to somehow filter/capture <br>> > the wpad  like dq.qname (http://allievi.sssup.it/techblog/archives/81)<br>> > <br>> > in my test environment (debian stretch and recursor version <br>> > 4.1.0~rc3-1pdns.stretch) I have this rule : <br>> > <br>> >    -- US-CERT TA16-144A.<br>> >       if (dq.qname:isPartOf(newDN("wpad")))<br>> >       then<br>> >          dq.rcode = 0<br>> >          dq:addAnswer(pdns.A, "127.0.0.1")<br>> >          return true;<br>> >       end<br>> > <br>> > but this doesn't seem to work, maybe I am misinterpreting<br>> > the isPartOf method , or maybe I should use :toString and <br>> > then use lua pattern matching.  <br>> <br>> isPartOf() returns true if the name is a sub-domain of the one passed in<br>> parameter, so here it would match any domain under the hypothetic .wpad<br>> TLD, which is not what you want. Lua pattern matching would be one of<br>> the various ways to do that, yes.<br><br> I switched the expression to this one <br><br>queryString=dq.qname:toString()<br><br>   -- US-CERT TA16-144A.<br>      if (querystring:match('^wpad%.')) <br>      then<br>         dq.rcode = 0<br>         dq:addAnswer(pdns.A, "127.0.0.1")<br>         return true;<br>      end<br><br>and this is working in the test environment.<br><br>I would like to know what other admins  thinks of this  <br>approach, I mean can it affect performances as it is "casting" <br>to string every query ? Am I the only one doing this ? <br><br>thanks to everybody<br><br>M.<br>---------------------------<br>  () ASCII Ribbon Campaign<br>  /\ Against HTML E-Mail<br>---------------------------<br>This mail is ubuntu Hostile<br>---------------------------<br>_______________________________________________<br>Pdns-users mailing list<br>Pdns-users@mailman.powerdns.com<br>https://mailman.powerdns.com/mailman/listinfo/pdns-users<br></remi.gacogne@powerdns.com>
                        </blockquote></div>