[Powermail-users] PDNS/LUA question

Andrew Turnbull andrewt at no-wires.co.uk
Wed Dec 12 22:32:26 CET 2012


Hi

I cannot seem to resolve this issue. Was wondering if you could help
me. (also when compiling with-modules="lua", you have to edit each
MakeFile and change lua5.1 to lua otherwise it fails)

This error, Im really not sure what its complaining about. The purpose
is to redirect domains using some dedicated nameservers setup to
purely redirect all queries to a website, not to blankly redirect
using my production nameservers.

/etc/init.d/pdns monitor

Dec 11 15:14:31 PowerDNS 3.1 (C) 2001-2012 PowerDNS.COM BV (Dec 11
2012, 15:01:56, gcc 4.4.6 20120305 (Red Hat 4.4.6-4)) starting up
Dec 11 15:14:31 PowerDNS comes with ABSOLUTELY NO WARRANTY. This is
free software, and you are welcome to redistribute it according to the
terms of the GPL version 2.
Dec 11 15:14:31 Creating backend connection for TCP
Dec 11 15:14:31 [LUABackend: (1)] Error: [LUABackend: (1)] MINIMAL
BACKEND: Missing required function(s)!
% Dec 11 15:14:31 Caught an exception instantiating a backend, cleaning up
Dec 11 15:14:31 TCP server is unable to launch backends - will try
again when questions come in: [LUABackend: (1)] MINIMAL BACKEND:
Missing required function(s)!
Dec 11 15:14:31 About to create 3 backend threads for UDP
Dec 11 15:14:31 [LUABackend: (1)] Error: [LUABackend: (1)] MINIMAL
BACKEND: Missing required function(s)!
Dec 11 15:14:31 Caught an exception instantiating a backend, cleaning up
Dec 11 15:14:31 [LUABackend: (1)] Error: [LUABackend: (1)] MINIMAL
BACKEND: Missing required function(s)!
Dec 11 15:14:31 Caught an exception instantiating a backend, cleaning up
Dec 11 15:14:31 [LUABackend: (1)] Error: [LUABackend: (1)] MINIMAL
BACKEND: Missing required function(s)!
Dec 11 15:14:31 Caught an exception instantiating a backend, cleaning up
Dec 11 15:14:31 Done launching threads, ready to distribute questions


Config file is

launch=lua
lua-filename=/usr/local/etc/rh-nxdom.lua
lua-logging-query=on
local-address=127.0.0.1

lua script

                more rh-nxdom.lua
ranges={
        "127.0.0.0/24",         -- localnet for debugging
}
hostnames={
        "www%.12345%.net", -- domain we want to be redirect if it
triggers an NXDOMAIN response
}
function postresolve ( ip, destination, domain, qtype )
        return -1, {}
end
function nxdomain ( ip, destination, domain, qtype )
        if qtype ~= 1 and qtype ~= 255
        then
                return -1, {}
        end
        if
                destination == "1.2.3.4"   -- your recursive nameservice ip
        then
                if matchnetmask(ip, ranges) -- this is a c function
that the recursor exports to the Lua script
                then
                        domain=string.lower(domain)
                        for i,v in pairs(hostnames)
                        do
                                if string.find(domain, "^" .. v .. "%.$")
                                then
                                        return 0, {
                                                {qtype="1",
content="1.2.3.4", ttl=3600, place="1"},
                                        }
                                end
                        end
               end
        end
        return -1, {}
end


More information about the Powermail-users mailing list