<div dir="ltr">Hi Michael,<div><br></div><div>You should be able to load the file <i>(if the list of zones is large enough and warrants a file)</i> or initialize array of subzones <i>(if there are few zones you want to test)</i> once, when the process starts and loads the Lua script. Loading the file on every request would definitely become a performance issue.</div><div><br></div><div>Best Regards,</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 14, 2018 at 10:50 AM Bit World Computing - Michael Mertel <<a href="mailto:michael.mertel@bwc.de">michael.mertel@bwc.de</a>> wrote:<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 style="overflow-wrap: break-word;">Hi Aleksandr,<div><br></div><div>ja Lua was the way I’m planning to go. But just wasn’t sure to use dnsdist or recursor, but probably does not matter in that case.</div><div><br></div><div>Does the file gets loaded for every request with io.open and could this become a performance issue in your opinion? All DNS requests from a fairly good used mail gateway would be sent to this resolver.</div><div><br></div><div>I think I’ll give it a try with dnsdist and see what happens.</div><div><br></div><div>Best regards.</div><div><br></div><div><br></div><div><br><div><blockquote type="cite"><div>Am 14.12.2018 um 12:55 schrieb Aleksandr Rogozin <<a href="mailto:arogozin@squarespace.com" target="_blank">arogozin@squarespace.com</a>>:</div><br class="gmail-m_-3948080513977817002Apple-interchange-newline"><div><div><div dir="auto">Hi Michael,</div></div><div dir="auto"><br></div><div dir="auto">I recommend using Lua to intercept the DNS queries. Both dnsdist and recursor should be able to support it. In Lua you can check for query type to be MX and load a list of domains from a file using ‘<span style="color:rgb(60,64,67);font-family:Roboto,HelveticaNeue,Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">io.open’. P</span><span style="color:rgb(60,64,67);font-family:Roboto,HelveticaNeue,Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">rovide necessary DNS response</span><span style="color:rgb(60,64,67);font-family:Roboto,HelveticaNeue,Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"> if the query matches your list of zones. Additionally, you might want to limit this operation to specific networks with NetMask or NetMaskGroup.</span></div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 14, 2018 at 01:53 Bit World Computing - Michael Mertel <<a href="mailto:michael.mertel@bwc.de" target="_blank">michael.mertel@bwc.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I’am looking for the most efficent way to spoof the answer of a MX query. I need to redirect outgoing e-mails (specific domains only) to a smtp gateway for further processing before it leaves the local network. I cannot use any kind of transport tables at the MTA, so my approach was to use dns therefore.<br>
<br>
The number of zones to spoof is currently not defined, could be dozens if not hundreds.<br>
<br>
I would usually do this kind of stuff with dnsdist (which I love), but would the recursor a better choice here?<br>
<br>
Thanks for any advice.<br>
<br>
—Michael<br>
<br>
_______________________________________________<br>
Pdns-users mailing list<br>
<a href="mailto:Pdns-users@mailman.powerdns.com" target="_blank">Pdns-users@mailman.powerdns.com</a><br>
<a href="https://mailman.powerdns.com/mailman/listinfo/pdns-users" rel="noreferrer" target="_blank">https://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>
</blockquote></div></div>
</div></blockquote></div><br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px"><br class="gmail-m_-3948080513977817002Apple-interchange-newline"></div></div></div></div></div></div></div></div>_______________________________________________<br>
Pdns-users mailing list<br>
<a href="mailto:Pdns-users@mailman.powerdns.com" target="_blank">Pdns-users@mailman.powerdns.com</a><br>
<a href="https://mailman.powerdns.com/mailman/listinfo/pdns-users" rel="noreferrer" target="_blank">https://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>
</blockquote></div>