commit 4c70f4747a6a49352130cf4e158cd6afbf373d5b Author: Your Name Date: Tue Dec 2 09:25:41 2014 +0000 backport query limiter to 3.5.3 diff --git a/pdns_recursor.cc b/pdns_recursor.cc index dcadf1b..3708137 100644 --- a/pdns_recursor.cc +++ b/pdns_recursor.cc @@ -533,7 +533,14 @@ void startDoResolve(void *p) bool variableAnswer = false; // if there is a RecursorLua active, and it 'took' the query in preResolve, we don't launch beginResolve if(!t_pdl->get() || !(*t_pdl)->preresolve(dc->d_remote, g_listenSocketsAddresses[dc->d_socket], dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), ret, res, &variableAnswer)) { - res = sr.beginResolve(dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_mdp.d_qclass, ret); + try { + res = sr.beginResolve(dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_mdp.d_qclass, ret); + } + catch(ImmediateServFailException &e) { + L<d_mdp.d_qname<<"' because: "<get()) { if(res == RCode::NoError) { diff --git a/syncres.cc b/syncres.cc index afadfbc..f98f116 100644 --- a/syncres.cc +++ b/syncres.cc @@ -915,6 +915,7 @@ int SyncRes::doResolveAt(set nameservers, string auth, } else { s_outqueries++; d_outqueries++; + if(d_outqueries > 50) throw ImmediateServFailException("more than 50 queries sent while resolving "+qname); TryTCP: if(doTCP) { LOG(prefix<toStringWithPort() <