[Pdns-users] LUA createReverse to simulate $GENERATE for a range of addresses

Erik Sejr eriksejr at gmail.com
Wed Jun 22 17:19:33 UTC 2022


Hi There,
I have been exploring a migration from BIND 9 to PowerDNS with plans to use
the pgsql backend. I have been reading over the docs and thinking
specifically about how I would be able to migrate our extensive use of
$GENERATE in our network.

It seems that based on the way createForward() and createReverse() function
it would make the most sense to group dynamically generated DNS records
under subdomains rather then keeping them in one very large zone and the
replacement of

$GENERATE 0-255 $ PTR 1-2-3-$.domain.com.

with

*.3.2.1 IN LUA PTR "createReverse('%5.domain.com.')"

is pretty straightforward. But what about these:

$GENERATE 10-20 $ PTR 1-2-3-$.domain.com.
21 IN PTR something.domain.com
22 IN PTR somethingelse.domain.com
$GENERATE 23-255 $ PTR 1-2-3-$.domain.com.

How does one do a range of addresses with createReverse() rather then
*.3.2.1.in-addr.arpa? or *.2.1.in-addr.arpa? Is there such a thing as:

10-20 IN LUA PTR "createReverse('%5.domain.com.')"
23-255 IN LUA PTR "createReverse('%5.domain.com.')"

I did read up on the exceptions list and in this example utilizing
something like that might be suitable, but there are many examples where
there would be "hundreds" of exceptions within a /24 and I don't think the
exceptions list would scale well in that regard. So I am hoping for
alternate options but I don't see a way with the variables LUA has access
to that would allow me to write a snippet of LUA code to check if a given
PTR record already exists in the zone and just return a generated one if
not, or even to check if the last octet for example was within a certain
range and if so generate the response with createReverse?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20220622/87416556/attachment.htm>


More information about the Pdns-users mailing list