Re: Lua view record - how to return NXDOMAIN?

Otto Moerbeek via Pdns-users <[email protected]> Wed, 30 Oct 2024 08:02:56 +0100
Newsgroups gmane.network.dns.powerdns.user
Message-ID <[email protected]>
On Tue, Oct 29, 2024 at 11:30:36PM +0000, Greg Owen via Pdns-users wrote:

> On Tue, Oct 29, 2024 at 10:14:29PM +0000, Djerk Geurts via Pdns-users wrote:
> > Is there a way to return NXDOMAIn instead of a valid response?
> > 
> > test IN LUA CNAME "view({{{'10.0.0.0/16'},{‘ns0.internal.domain.com.'}},{{'0.0.0.0/0'},{''}}})”
> > 
> > I would like to return NXDOMAIN instead of SERVFAIL for sources outside 10.0/16.
> 
> I've got some old code that does it like this:
> 
> 	name.rcode = pdns.NXDOMAIN
> 	return true;
> 
> This is in function preresolve(name). You can look at the code at 
> https://github.com/gowenfawr/dnSentry/blob/main/dnSentry.lua
> 
> -- 
>     gowen - Greg Owen - [email protected]

I sense some confusion between Lua records in the authoritative server
and Lua scripting in the recursor. Same language, different beasts.

	-Otto
_______________________________________________
Pdns-users mailing list
[email protected]
https://mailman.powerdns.com/mailman/listinfo/pdns-users