[Pdns-users] PDNS-recursor URL redirect issue

Marco Tizzano m.tizzano at gyala.it
Fri Dec 2 10:07:35 UTC 2016


Hi all,

 

I have configured PDNS recursor 4.0 to filter domains. All works fine, black
listed domain are filtered properly, but the user receive the message
"Server not found" on his browser.

So now I'm trying to configure a URL redirection to a specific web page but
with no luck, URL redirection not occur.

Follows the Lua script witch filter url request and redirect to specific web
page if necessary:

 

"adservers=newDS()

adservers:add(dofile("/opt/focus/Lists/blocklist.lua"))

 

function preresolve(dq)

    if(not adservers:check(dq.qname) or (dq.qtype ~= pdns.A and dq.qtype ~=
pdns.AAAA)) then

        return false

    end

    

    dq:addRecord(pdns.SOA,

        "fake."..dq.qname:toString().." fake."..dq.qname:toString().." 1
7200 900 1209600 86400",

       2)

 

    return 0, {{qtype=pdns.A, content="xxx.xxx.xxx.xxx", ttl=3600,
place="1"}} 

end"

 

When I try to resolve a filtered domain I found this log on PDNS server:

Dec  2 01:52:36 localhost pdns_recursor: Dec 02 10:52:36 STL error
(www.example.com/A from 127.0.0.1): Trying to cast a lua variable from
"number" to "b"

 

Someone can help me for this specific configuration?

 

Thanks in advance 

 

Marco

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


More information about the Pdns-users mailing list