[Pdns-users] Correct incantation of followCNAMERecords and follupDomain
Otto Moerbeek
otto at drijf.net
Tue Mar 24 15:39:57 UTC 2026
On Tue, Mar 24, 2026 at 01:54:23PM +0000, Scott Holder via Pdns-users wrote:
> Hey folks,
>
> I’m working on a thing where we’re basically tearing apart a DNS response and replacing the entire thing with a CNAME to an internal address. I’ve managed to get It to replace the answer section with the CNAME, but that’s all the answer section ends up with which leads to it not actually resolving. It doesn’t seem to be doing any CNAME chasing or continuation.
>
> It sounds like the dq.followupFunction of followCNAMERecords and giving it a followupDomain should be exactly what I need, but I can’t quite figure out where to add it and the specific format. I’ve tried a few different spots and only ever get an “Unknown Lua error” when trying to do a dig. Do they work in the postresolve section? Is there some trick to where they need to live in the Lua script? Am I misunderstanding what they’re supposed to do all together?
>
> Thanks!
> Scott H.
https://docs.powerdns.com/recursor/lua-scripting/hooks.html#example-script
shows an example. I believe it should also work in postresolve.
Looking a bit more, it seems the docs are wrong. followCNAMERecords
picks up the target from the answers (potentially added by Lua code).
followupDomain does not play a role.
If that does not help, can you show us the Lua code you are using. Do
the logs show anything?
-Otto
More information about the Pdns-users
mailing list