Unverified Commit beae6dd4 authored by Gavin Brown's avatar Gavin Brown
Browse files

option to expect a particular RCODE

parent ee802bf6
......@@ -275,8 +275,8 @@ sub time_query {
debug($@);
}
if (!$result) {
return undef;
if (!$result || (defined($CONF->{'ResponseCode'}) && $result->header->rcode ne $CONF->{'ResponseCode'})) {
return undef;
} else {
return $dt;
......@@ -324,6 +324,7 @@ sub load_config {
$CONF->{'Timeout'} = $ini->param('Timeout') || 1;
$CONF->{'Recurse'} = $ini->param('Recurse') eq 'true' || undef;
$CONF->{'Question'} = $ini->param('Question') || '. A IN';
$CONF->{'ResponseCode'} = $ini->param('ResponseCode') || undef;
$CONF->{'Servers'} = $ini->param('Servers') || undef;
$CONF->{'Domains'} = $ini->param('Domains') || undef;
$CONF->{'StatsFile'} = $ini->param('StatsFile') || undef;
......@@ -911,6 +912,14 @@ Default: C<example.com. IN A>
Specify the DNS question. The format is "QNAME QCLASS QTYPE".
=head2 C<ResponseCode RCODE>
Default: none
Specify the expected RCODE. If the RCODE does not match the server is
assumed to be down. If no value is specified, any RCODE will be
accepted.
=head2 C<Servers SERVERS>
Default: none
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment