thread_local std::unique_ptr<MemRecursorCache> t_RC;
thread_local std::unique_ptr<RecursorPacketCache> t_packetCache;
thread_local FDMultiplexer* t_fdm{nullptr};
-thread_local std::unique_ptr<addrringbuf_t> t_remotes, t_servfailremotes, t_largeanswerremotes;
-thread_local std::unique_ptr<boost::circular_buffer<pair<DNSName, uint16_t> > > t_queryring, t_servfailqueryring;
+thread_local std::unique_ptr<addrringbuf_t> t_remotes, t_servfailremotes, t_largeanswerremotes, t_bogusremotes;
+thread_local std::unique_ptr<boost::circular_buffer<pair<DNSName, uint16_t> > > t_queryring, t_servfailqueryring, t_bogusqueryring;
thread_local std::shared_ptr<NetmaskGroup> t_allowFrom;
#ifdef HAVE_PROTOBUF
thread_local std::unique_ptr<boost::uuids::random_generator> t_uuidGenerator;
pw.getHeader()->ad=0;
}
else if(state == Bogus) {
+ if(t_bogusremotes)
+ t_bogusremotes->push_back(dc->d_source);
+ if(t_bogusqueryring)
+ t_bogusqueryring->push_back(make_pair(dc->d_mdp.d_qname, dc->d_mdp.d_qtype));
if(g_dnssecLogBogus || sr.doLog() || g_dnssecmode == DNSSECMode::ValidateForLog) {
g_log<<Logger::Warning<<"Answer to "<<dc->d_mdp.d_qname<<"|"<<QType(dc->d_mdp.d_qtype).getName()<<" for "<<dc->getRemote()<<" validates as Bogus"<<endl;
}
t_remotes->set_capacity(ringsize);
t_servfailremotes = std::unique_ptr<addrringbuf_t>(new addrringbuf_t());
t_servfailremotes->set_capacity(ringsize);
+ t_bogusremotes = std::unique_ptr<addrringbuf_t>(new addrringbuf_t());
+ t_bogusremotes->set_capacity(ringsize);
t_largeanswerremotes = std::unique_ptr<addrringbuf_t>(new addrringbuf_t());
t_largeanswerremotes->set_capacity(ringsize);
t_queryring->set_capacity(ringsize);
t_servfailqueryring = std::unique_ptr<boost::circular_buffer<pair<DNSName, uint16_t> > >(new boost::circular_buffer<pair<DNSName, uint16_t> >());
t_servfailqueryring->set_capacity(ringsize);
+ t_bogusqueryring = std::unique_ptr<boost::circular_buffer<pair<DNSName, uint16_t> > >(new boost::circular_buffer<pair<DNSName, uint16_t> >());
+ t_bogusqueryring->set_capacity(ringsize);
}
MT=std::unique_ptr<MTasker<PacketID,string> >(new MTasker<PacketID,string>(::arg().asNum("stack-size")));
void sortPublicSuffixList();
std::vector<std::pair<DNSName, uint16_t> >* pleaseGetQueryRing();
std::vector<std::pair<DNSName, uint16_t> >* pleaseGetServfailQueryRing();
+std::vector<std::pair<DNSName, uint16_t> >* pleaseGetBogusQueryRing();
std::vector<ComboAddress>* pleaseGetRemotes();
std::vector<ComboAddress>* pleaseGetServfailRemotes();
+std::vector<ComboAddress>* pleaseGetBogusRemotes();
std::vector<ComboAddress>* pleaseGetLargeAnswerRemotes();
DNSName getRegisteredName(const DNSName& dom);
std::atomic<unsigned long>* getDynMetric(const std::string& str);
}
return ret;
}
+vector<pair<DNSName,uint16_t> >* pleaseGetBogusQueryRing()
+{
+ typedef pair<DNSName,uint16_t> query_t;
+ vector<query_t>* ret = new vector<query_t>();
+ if(!t_bogusqueryring)
+ return ret;
+ ret->reserve(t_bogusqueryring->size());
+ for(const query_t& q : *t_bogusqueryring) {
+ ret->push_back(q);
+ }
+ return ret;
+}
return ret;
}
+vector<ComboAddress>* pleaseGetBogusRemotes()
+{
+ vector<ComboAddress>* ret = new vector<ComboAddress>();
+ if(!t_bogusremotes)
+ return ret;
+ ret->reserve(t_bogusremotes->size());
+ for(const ComboAddress& ca : *t_bogusremotes) {
+ ret->push_back(ca);
+ }
+ return ret;
+}
+
vector<ComboAddress>* pleaseGetLargeAnswerRemotes()
{
vector<ComboAddress>* ret = new vector<ComboAddress>();
"top-pub-queries show top queries grouped by public suffix list\n"
"top-remotes show top remotes\n"
"top-servfail-queries show top queries receiving servfail answers\n"
+"top-bogus-queries show top queries validating as bogus\n"
"top-pub-servfail-queries show top queries receiving servfail answers grouped by public suffix list\n"
+"top-pub-bogus-queries show top queries validating as bogus grouped by public suffix list\n"
"top-servfail-remotes show top remotes receiving servfail answers\n"
+"top-bogus-remotes show top remotes receiving bogus answers\n"
"unload-lua-script unload Lua script\n"
"version return Recursor version number\n"
"wipe-cache domain0 [domain1] .. wipe domain data from cache\n";
if(cmd=="top-pub-servfail-queries")
return doGenericTopQueries(pleaseGetServfailQueryRing, getRegisteredName);
+ if(cmd=="top-bogus-queries")
+ return doGenericTopQueries(pleaseGetBogusQueryRing);
+
+ if(cmd=="top-pub-bogus-queries")
+ return doGenericTopQueries(pleaseGetBogusQueryRing, getRegisteredName);
+
if(cmd=="top-servfail-remotes")
return doGenericTopRemotes(pleaseGetServfailRemotes);
+ if(cmd=="top-bogus-remotes")
+ return doGenericTopRemotes(pleaseGetBogusRemotes);
+
if(cmd=="top-largeanswer-remotes")
return doGenericTopRemotes(pleaseGetLargeAnswerRemotes);
Shows the top-20 queries causing servfail responses. Statistics are over
the last 'stats-ringbuffer-entries' queries.
+top-bogus-queries
+ Shows the top-20 queries causing bogus responses. Statistics are over
+ the last 'stats-ringbuffer-entries' queries.
+
top-pub-servfail-queries
Shows the top-20 queries causing servfail responses grouped by public
suffix list. Statistics are over the last 'stats-ringbuffer-entries'
queries.
+top-pub-bogus-queries
+ Shows the top-20 queries causing bogus responses grouped by public
+ suffix list. Statistics are over the last 'stats-ringbuffer-entries'
+ queries.
+
top-servfail-remotes
Shows the top-20 most active remote hosts causing servfail responses.
Statistics are over the last 'stats-ringbuffer-entries' queries.
+top-bogus-remotes
+ Shows the top-20 most active remote hosts causing bogus responses.
+ Statistics are over the last 'stats-ringbuffer-entries' queries.
+
trace-regex *REGEX*
Emit resolution trace for matching queries. Empty regex to disable trace.
</div>
<div class="stats-table" id="queryring"></div>
<div class="stats-table" id="servfailqueryring"></div>
+ <div class="stats-table" id="bogusqueryring"></div>
</div>
<div class="table-container">
<div class="filter"></div>
<div class="stats-table" id="remotering"></div>
<div class="stats-table" id="servfailremotering"></div>
+ <div class="stats-table" id="bogusremotering"></div>
</div>
</div>
</table>
</script>
+<script id="bogusqueryring-template" type="text/x-handlebars-template">
+ <table class="three-col">
+ <tr>
+ <th>Number</th>
+ <th>Bogus domain</th>
+ <th>Type</th>
+ </tr>
+ {{#each rows}}
+ <tr>
+ <td>{{0}}</td>
+ <td>{{1}}</td>
+ <td>{{2}}</td>
+ </tr>
+ {{/each}}
+ </table>
+</script>
+
<script id="remotering-template" type="text/x-handlebars-template">
<table class="two-col">
<tr>
</table>
</script>
+<script id="bogusremotering-template" type="text/x-handlebars-template">
+ <table class="two-col">
+ <tr>
+ <th>Number</th>
+ <th>Bogus remote</th>
+ </tr>
+ {{#each rows}}
+ <tr>
+ <td>{{0}}</td>
+ <td>{{1}}</td>
+ </tr>
+ {{/each}}
+ </table>
+</script>
+
</body>
</html>
render('servfailqueryring', {rows: rows});
});
+ $.getJSON('jsonstat', jsonstatParams('get-query-ring', 'bogus-queries', $("#filter1").is(':checked')),
+ function (data) {
+ var rows = makeRingRows(data);
+ render('bogusqueryring', {rows: rows});
+ });
+
$.getJSON('jsonstat', jsonstatParams('get-remote-ring', 'remotes', false),
function (data) {
var rows = makeRingRows(data);
var rows = makeRingRows(data);
render('servfailremotering', {rows: rows});
});
+
+ $.getJSON('jsonstat', jsonstatParams('get-remote-ring', 'bogus-remotes', false),
+ function (data) {
+ var rows = makeRingRows(data);
+ render('bogusremotering', {rows: rows});
+ });
}
var connectionOK = function (ok, o) {
};
typedef boost::circular_buffer<ComboAddress> addrringbuf_t;
-extern thread_local std::unique_ptr<addrringbuf_t> t_servfailremotes, t_largeanswerremotes, t_remotes;
+extern thread_local std::unique_ptr<addrringbuf_t> t_servfailremotes, t_largeanswerremotes, t_remotes, t_bogusremotes;
-extern thread_local std::unique_ptr<boost::circular_buffer<pair<DNSName,uint16_t> > > t_queryring, t_servfailqueryring;
+extern thread_local std::unique_ptr<boost::circular_buffer<pair<DNSName,uint16_t> > > t_queryring, t_servfailqueryring, t_bogusqueryring;
extern thread_local std::shared_ptr<NetmaskGroup> t_allowFrom;
string doQueueReloadLuaScript(vector<string>::const_iterator begin, vector<string>::const_iterator end);
string doTraceRegex(vector<string>::const_iterator begin, vector<string>::const_iterator end);
if(req->getvars["name"]=="servfail-queries")
queries=broadcastAccFunction<vector<query_t> >(pleaseGetServfailQueryRing);
+ if(req->getvars["name"]=="bogus-queries")
+ queries=broadcastAccFunction<vector<query_t> >(pleaseGetBogusQueryRing);
else if(req->getvars["name"]=="queries")
queries=broadcastAccFunction<vector<query_t> >(pleaseGetQueryRing);
queries=broadcastAccFunction<vector<ComboAddress> >(pleaseGetRemotes);
else if(req->getvars["name"]=="servfail-remotes")
queries=broadcastAccFunction<vector<ComboAddress> >(pleaseGetServfailRemotes);
+ else if(req->getvars["name"]=="bogus-remotes")
+ queries=broadcastAccFunction<vector<ComboAddress> >(pleaseGetBogusRemotes);
else if(req->getvars["name"]=="large-answer-remotes")
queries=broadcastAccFunction<vector<ComboAddress> >(pleaseGetLargeAnswerRemotes);