[Pdns-users] pdns-recursor lua script - redirect query

Grzegorz Chmurzyński chmurzynski at kei.pl
Tue Feb 20 09:22:35 UTC 2024


I'm trying to change queries for zen.spamhaus.org to another domain 
(paid service).

Convert all type queries on the fly to queries of the following type:
4.3.2.1.zen.spamhaus.org -> 4.3.2.1.xxxxx.zen.dq.spamhaus.net

I wrote the following lua script:
https://pastebin.com/qssbsNtR

Redirection via CNAME works, but during DNS queries it always receives a 
CNAME record, which is then handled with "followCNAMERecords"

Normal query:
https://pastebin.com/kAzQPN0r

Query changed by LUA (add CNAME):
https://pastebin.com/5y31c1zV

Is it possible to immediately ask about the A record values of the 
another domain (4.3.2.1.xxxxx.zen.dq.spamhaus.net) in the LUA script and 
then return them as a response, instead of adding the CNAME value?


-- 
Pozdrawiam,
GChmurka



More information about the Pdns-users mailing list