Skip to content
This repository
tree: a9be2e19b6
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 36 lines (31 sloc) 0.925 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
##! Find, measure, and log the number of missing AAAA records for incoming
##! AAAA requests. This can be used to create a priority list of domains
##! to enable with IPv6 since it will show the most frequently requested sites
##! that don't currently have IPv6.
##!
##! Note::
##! Site::local_zones must be configured in order for this script to work.
##!
##! Todo::
##! We are ignoring the rcode right now because of a small problem in the
##! base DNS scripts for 2.0 and 2.1.

@load base/frameworks/metrics

export {
redef enum Metrics::ID += {
MISSING_AAAA
};
}

event bro_init()
{
Metrics::add_filter(MISSING_AAAA, [$break_interval=1hr]);
}

event DNS::log_dns(rec: DNS::Info)
{
if ( rec?$query && rec?$qtype && !rec?$answers &&
#rec?$rcode && rec$rcode == 0 &&
rec$qtype == 28 &&
Site::is_local_name(rec$query) )
{
Metrics::add_data(MISSING_AAAA, [$str=rec$query], 1);
}
}
Something went wrong with that request. Please try again.