From: Bert Hubert Date: Mon, 14 Jun 2010 18:05:22 +0000 (+0000) Subject: add dont-queries statistic, plus make sure we add :: and 0.0.0.0 to the dontquery... X-Git-Tag: rec-3.3~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66e0b6ea11da74e82eacfda70d32b91c16e4016e;p=pdns add dont-queries statistic, plus make sure we add :: and 0.0.0.0 to the dontquery list git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1637 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 3460ac0f7..7a373b93a 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1590,6 +1590,8 @@ int serviceMain(int argc, char*argv[]) g_dontQuery=new NetmaskGroup; vector ips; stringtok(ips, ::arg()["dont-query"], ", "); + ips.push_back("0.0.0.0"); + ips.push_back("::"); L<::const_iterator i = ips.begin(); i!= ips.end(); ++i) { g_dontQuery->addMask(*i); diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 7edc81ffa..52dce418f 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -390,6 +390,7 @@ RecursorControlParser::RecursorControlParser() addGetStat("all-outqueries", &SyncRes::s_outqueries); addGetStat("ipv6-outqueries", &g_stats.ipv6queries); addGetStat("throttled-outqueries", &SyncRes::s_throttledqueries); + addGetStat("dont-outqueries", &SyncRes::s_dontqueries); addGetStat("throttled-out", &SyncRes::s_throttledqueries); addGetStat("unreachables", &SyncRes::s_unreachables); addGetStat("chain-resends", &g_stats.chainResends); diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 146e21af0..71878efe5 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -48,6 +48,7 @@ unsigned int SyncRes::s_outgoingtimeouts; unsigned int SyncRes::s_outqueries; unsigned int SyncRes::s_tcpoutqueries; unsigned int SyncRes::s_throttledqueries; +unsigned int SyncRes::s_dontqueries; unsigned int SyncRes::s_nodelegated; unsigned int SyncRes::s_unreachables; bool SyncRes::s_doIPv6; @@ -864,6 +865,7 @@ int SyncRes::doResolveAt(set nameservers, string auth, } else if(!pierceDontQuery && g_dontQuery && g_dontQuery->match(&*remoteIP)) { LOG<toString() << ", blocked by 'dont-query' setting" << endl; + s_dontqueries++; continue; } else { diff --git a/pdns/syncres.hh b/pdns/syncres.hh index b6b857d14..3df31b361 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -199,6 +199,7 @@ public: static unsigned int s_queries; static unsigned int s_outgoingtimeouts; static unsigned int s_throttledqueries; + static unsigned int s_dontqueries; static unsigned int s_outqueries; static unsigned int s_tcpoutqueries; static unsigned int s_nodelegated;