[Pdns-users] Lua view record - how to return NXDOMAIN?

Otto Moerbeek otto at drijf.net
Wed Oct 30 07:02:56 UTC 2024


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 - gowen at swynwyr.com

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

	-Otto


More information about the Pdns-users mailing list