END
&Header::closebox();
}
###
# Section to display the configured and used DNS servers.
#
sub show_nameservers () {
&Header::openbox('100%', 'center', "$Lang::tr{'dns servers'}");
# Determine if we are running in recursor mode
my $recursor = 0;
my $unbound_forward = qx(unbound-control forward);
if ($unbound_forward =~ m/^off/) {
$recursor = 1;
}
my $dns_status_string;
my $dns_status_col;
my $dns_working;
# Test if the DNS system is working.
#
# Simple send a request to unbound and check if it can resolve the
# DNS test server.
my $dns_status_ret = &check_nameserver("127.0.0.1", "$dns_test_server", "UDP", undef, "+timeout=5", "+retry=0");
if ($dns_status_ret eq "2") {
$dns_status_string = "$Lang::tr{'working'}";
$dns_status_col = "${Header::colourgreen}";
$dns_working = 1;
} else {
$dns_status_string = "$Lang::tr{'broken'}";
$dns_status_col = "${Header::colourred}";
}
if ($recursor) {
$dns_status_string .= " (" . $Lang::tr{'dns recursor mode'} . ")";
}
print <