[Pdns-users] LUA script for primary server

Djerk Geurts djerk at maizymoo.com
Mon Jun 6 12:35:37 UTC 2022


> On 6 Jun 2022, at 12:44, Brian Candler <b.candler at pobox.com> wrote:
> 
> On 06/06/2022 11:34, Djerk Geurts wrote:
>> Maybe if I add some examples:
>> 
>> 1.2.3.4.5.6.e164.arpa. NAPTR “some text with sip call routing info: AAA”
>> *.4.5.6.e164.arpa. NAPTR “some different sip call routing info: BBB”
>> 
>> A query for 9.9.9.4.5.6.e164.arpa. will result in BBB
>> A query for 1.2.3.4.5.6.e164.arpa. yields AAA
>> A query for 3.3.3.4.5.6.e164.arpa. yields NXDOMAIN
>> 
>> The above is all according to RFC and expected PowerDNS behaviour.
> Yep. Depending on your use case and how many domains you have, it might be possible to implement
> 
> *.e164.arpa. LUA NAPTR "// some LUA code here"
> 
> The query name, including the part matched by the wildcard, should be available in a query variable <https://doc.powerdns.com/authoritative/lua-records/functions.html#query-variables>.
> 
> Or there is the Lua2 backend <https://doc.powerdns.com/authoritative/backends/lua2.html> (in the Ubuntu packages it's in a separate package "pdns-backend-lua2"), or other backends <https://doc.powerdns.com/authoritative/backends/index.html> like pipe and remote.
> 
The issue with that is that I would have to create many LUA records, which defeats the point as the LUA record wouldn’t match in the same way that the ‘parent’ wildcard NAPTR record would.

I disregarded the Lua2 backend as I need the zone to reside in a MySQL backend, I doubt I can split a zone between MySQL and Lua2. Unless I have Lua2 do the SQL queries, but that would make things even more complex.

I’m hoping I can intercept nxdomain responses and rewrite them to a CNAME record answer to the client.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20220606/815980ac/attachment.htm>


More information about the Pdns-users mailing list