function preresolve ( ip, destination, domain, qtype )
-- we only answer IN TXT the.time. and return not answered for anything else
if domain == "the.time."
then
d=os.date("\"%c\"")
ret={
{qtype="16", ttl=1, place="1", content=d},
}
if qtype == pdns.TXT
then
return 0, ret
else
return -1, {}
end
end
if domain == "www.powerdns.org." and qtype == pdns.A
then
ret={
{qtype=pdns.A, place="1", ttl=86400, content="85.17.220.215"},
}
return 0, ret
end
-- this is important, we need to signal the recursor that we did _not_ answer the query
-- i.e. even if the query is for www.powerdns.org but not of type IN A we can still recurse for that
return -1, {}
end