[Pdns-users] Issue while using LUA on recursor: STL error Trying to cast a lua variable from "nil" to "b"

David Touzeau david at articatech.com
Wed May 2 08:55:46 UTC 2018


Hi all

 

 

When using the LUA script i have the following error, and the service did
not answer to any query

 

ay  1 18:13:59 dhcp pdns_recursor[242409]: Got question for www.ibm.com.
from 192.168.1.214 to 192.168.1.144

May  1 18:13:59 dhcp pdns_recursor[242409]: STL error (www.ibm.com/A from
192.168.1.214): Trying to cast a lua variable from "nil" to "b"

May  1 18:14:02 dhcp pdns_recursor[242409]: Got question for
www.msftncsi.com. from 127.0.0.1 to 127.0.0.1

May  1 18:14:02 dhcp pdns_recursor[242409]: STL error (www.msftncsi.com/A
from 127.0.0.1): Trying to cast a lua variable from "nil" to "b"

May  1 18:14:02 dhcp pdns_recursor[242409]: Got question for
www.msftncsi.com. from 127.0.0.1 to 127.0.0.1

May  1 18:14:02 dhcp pdns_recursor[242409]: STL error (www.msftncsi.com/AAAA
from 127.0.0.1): Trying to cast a lua variable from "nil" to "b"

May  1 18:14:04 dhcp pdns_recursor[242409]: Got question for www.ibm.com.
from 192.168.1.214 to 192.168.1.144

May  1 18:14:04 dhcp pdns_recursor[242409]: STL error (www.ibm.com/A from
192.168.1.214): Trying to cast a lua variable from "nil" to "b"

May  1 18:14:09 dhcp pdns_recursor[242409]: Got question for www.ibm.com.
from 192.168.1.214 to 192.168.1.144

May  1 18:14:09 dhcp pdns_recursor[242409]: STL error (www.ibm.com/A from
192.168.1.214): Trying to cast a lua variable from "nil" to "b"

 

Whats wrong ?

 

For testing i have the following code :

#
----------------------------------------------------------------------------
-------------------------------------------------

 

pdnslog("pdns-recursor Lua script starting!", pdns.loglevels.Warning)

 

 

function preresolve(dq)

    

    Question=dq.qname:toString()

    ClientIP=dq.remoteaddr:toString()

    pdnslog("Got question for "..Question.." from "..ClientIP,
pdns.loglevels.Warning)

    return false

    

end

 

function postresolve(dq)

                pdnslog("postresolve called for "..dq.qname:toString())

                local records = dq:getRecords()

                return false

end

 

function ipfilter(rem, loc, dh)

                print("ipfilter called, rem: ", rem:toStringWithPort(),
"loc: ",loc:toStringWithPort(),"match:", badips:match(rem))

                print("id: ",dh:getID(), "aa: ", dh:getAA(), "ad: ",
dh:getAD(), "arcount: ", dh:getARCOUNT())

                print("ports: ",rem:getPort(),loc:getPort())

                return badips:match(rem)

end

 

#
----------------------------------------------------------------------------
-------------------------------------------------

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20180502/d3734c24/attachment.html>


More information about the Pdns-users mailing list