return false;
}
-bool RecursorLua::prequery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res)
+bool RecursorLua::preoutquery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res)
{
return false;
}
return passthrough("postresolve", remote, local, query, qtype, ret, res, variable);
}
-bool RecursorLua::prequery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res)
+bool RecursorLua::preoutquery(const ComboAddress& remote, const ComboAddress& local,const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res)
{
- return passthrough("prequery", remote, local, query, qtype, ret, res, 0);
+ return passthrough("preoutquery", remote, local, query, qtype, ret, res, 0);
}
d_local = local;
/* the first argument */
- if(strcmp(func.c_str(),"prequery"))
+ if(strcmp(func.c_str(),"preoutquery"))
lua_pushstring(d_lua, remote.toString().c_str() );
else {
ComboAddress* ca=(ComboAddress*)lua_newuserdata(d_lua, sizeof(ComboAddress));
bool nxdomain(const ComboAddress& remote, const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret, bool* variable);
bool nodata(const ComboAddress& remote, const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret, bool* variable);
bool postresolve(const ComboAddress& remote, const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret, bool* variable);
- bool prequery(const ComboAddress& requestor, const ComboAddress& ns, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret);
+ bool preoutquery(const ComboAddress& requestor, const ComboAddress& ns, const string& query, const QType& qtype, vector<DNSResourceRecord>& res, int& ret);
private:
bool passthrough(const string& func, const ComboAddress& remote,const ComboAddress& local, const string& query, const QType& qtype, vector<DNSResourceRecord>& ret, int& res, bool* variable);
return origrcode, records
end
-function prequery(remoteip, domain, qtype)
- print("pdns wants to ask "..remoteip.." about "..domain.." "..qtype)
- if(remoteip=="192.121.121.14")
- then
- return -3,{}
- else
- return -1,{}
- end
-end
-
-
nmg=iputils.newnmgroup()
nmg:add("192.121.121.0/24")
-function prequery(remoteip, domain, qtype)
+function preoutquery(remoteip, domain, qtype)
print("pdns wants to ask "..remoteip:tostring().." about "..domain.." "..qtype)
if(nmg:match(remoteip))
then
s_tcpoutqueries++; d_tcpoutqueries++;
}
- if(d_pdl && d_pdl->prequery(*remoteIP, *remoteIP, qname, qtype, lwr.d_result, resolveret)) {
+ if(d_pdl && d_pdl->preoutquery(*remoteIP, *remoteIP, qname, qtype, lwr.d_result, resolveret)) {
LOG(prefix<<qname<<": query handled by Lua"<<endl);
}
else