[Pdns-dev] change qname before send query to authoritative server through pdns-recursor
    Pieter Lexis 
    pieter.lexis at powerdns.com
       
    Tue Aug 22 16:36:04 UTC 2017
    
    
  
Hello Kein-Wai,
On Mon, 21 Aug 2017 13:58:24 +0000 (GMT+00:00)
"Cheung, Kein-Wai" <kwcheung at pccwglobal.com> wrote:
> I would like to know if POWERDNS scripting solution (using LUA) it's able
> to :
> 
>  
> 
> During the Interception of a Query:
> 
> .         Grab the qname (dq.qname)
> .         Compare it or analyse it with some LUA string methods
> .         Depend of the results, modify the dq.qname
> .         That qname will be send to the Authoritative server for query
> searching and response.
It is not possible to directly change the QNAME. However, is it possible to add a CNAME record to another name via dq.followupDomain and set dq.followupFunction[1] to followCNAMERecords[2].
The QName of the query can be inspected in either 'DNSName'-form[3] or strings (by calling :toString()).
Hope this helps!
Best regards,
Pieter
1 - https://doc.powerdns.com/recursor/lua-scripting/dq.html#DNSQuestion.followupFunction.
2 - https://doc.powerdns.com/recursor/lua-scripting/hooks.html#cname-chain-resolution
3 - https://doc.powerdns.com/recursor/lua-scripting/dnsname.html
-- 
Pieter Lexis
PowerDNS.COM BV -- https://www.powerdns.com
    
    
More information about the Pdns-dev
mailing list