<div dir="ltr"><div>Otto,</div><div>Thank you for your answer. I have continued to test ways to make PowerDNS work for us, but even with it functioning as described I just can't find a good way around scenarios where we have a /24 split into dynamic address space for multiple uses/customers. Since we tend to include some "metadata" in our reverse lookup responses for dynamically allocated address space I run into the problem you described where I have in BIND:</div><div><br></div><div><pre class="gmail-c-mrkdwn__pre" style="box-sizing:inherit;margin:4px 0px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;white-space:pre-wrap;word-break:normal;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;border-radius:4px;color:rgb(29,28,29);font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">$GENERATE 1-64 IN PTR place1-purpose-1-2.3-$.<a href="http://domain.com">domain.com</a>
$GENERATE 65-127 IN PTR place2-purpose-1-2-3-$.<a href="http://domain.com">domain.com</a><br>$GENERATE 128-255 IN PTR place3-purpose-1-2-3-$.<a href="http://domain.com">domain.com</a><br><br></pre><div>I just can't see a way of doing something like this in PowerDNS with LUA records in an authoritative server that would be comparable in convenience and simplicity. I have decided to look more closely at BIND 9 and see if I can get some of the features I'm after working better in BIND instead.</div><div><br></div><div>Erik<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 23, 2022 at 9:20 AM Otto Moerbeek <<a href="mailto:otto@drijf.net">otto@drijf.net</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">On Wed, Jun 22, 2022 at 01:19:33PM -0400, Erik Sejr via Pdns-users wrote:<br>
<br>
> Hi There,<br>
> I have been exploring a migration from BIND 9 to PowerDNS with plans to use<br>
> the pgsql backend. I have been reading over the docs and thinking<br>
> specifically about how I would be able to migrate our extensive use of<br>
> $GENERATE in our network.<br>
> <br>
> It seems that based on the way createForward() and createReverse() function<br>
> it would make the most sense to group dynamically generated DNS records<br>
> under subdomains rather then keeping them in one very large zone and the<br>
> replacement of<br>
> <br>
> $GENERATE 0-255 $ PTR 1-2-3-$.<a href="http://domain.com" rel="noreferrer" target="_blank">domain.com</a>.<br>
> <br>
> with<br>
> <br>
> *.3.2.1 IN LUA PTR "createReverse('%<a href="http://5.domain.com" target="_blank">5.domain.com</a>.')"<br>
> <br>
> is pretty straightforward. But what about these:<br>
> <br>
> $GENERATE 10-20 $ PTR 1-2-3-$.<a href="http://domain.com" rel="noreferrer" target="_blank">domain.com</a>.<br>
> 21 IN PTR <a href="http://something.domain.com" rel="noreferrer" target="_blank">something.domain.com</a><br>
> 22 IN PTR <a href="http://somethingelse.domain.com" rel="noreferrer" target="_blank">somethingelse.domain.com</a><br>
> $GENERATE 23-255 $ PTR 1-2-3-$.<a href="http://domain.com" rel="noreferrer" target="_blank">domain.com</a>.<br>
> <br>
> How does one do a range of addresses with createReverse() rather then<br>
> *.3.2.1.in-addr.arpa? or *.2.1.in-addr.arpa? Is there such a thing as:<br>
> <br>
> 10-20 IN LUA PTR "createReverse('%<a href="http://5.domain.com" target="_blank">5.domain.com</a>.')"<br>
> 23-255 IN LUA PTR "createReverse('%<a href="http://5.domain.com" target="_blank">5.domain.com</a>.')"<br>
> <br>
> I did read up on the exceptions list and in this example utilizing<br>
> something like that might be suitable, but there are many examples where<br>
> there would be "hundreds" of exceptions within a /24 and I don't think the<br>
> exceptions list would scale well in that regard. So I am hoping for<br>
> alternate options but I don't see a way with the variables LUA has access<br>
> to that would allow me to write a snippet of LUA code to check if a given<br>
> PTR record already exists in the zone and just return a generated one if<br>
> not, or even to check if the last octet for example was within a certain<br>
> range and if so generate the response with createReverse?<br>
> <br>
> Thanks<br>
<br>
Explicit matches already have a higher precedence.<br>
<br>
So<br>
<br>
21.3.2.1.mydomain IN PTR <a href="http://something.domain.com" rel="noreferrer" target="_blank">something.domain.com</a><br>
22.3.2.1.mydomain IN PTR somethingelse.domain.comOA<br>
*.3.2.1.mydomain IN LUA PTR "createReverse('%4%.domain.com.')"<br>
<br>
will do what you want, making the wildcard the default, only used if<br>
no other name matches. If you have two ranges in the same label that<br>
should use different createReverse() calls this does not work. In that<br>
case you can write a piece of Lua that returns the proper string.<br>
<br>
        -Otto<br>
</blockquote></div>