mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-15 13:32:59 +02:00
dns.cgi: Shorten time when checking if DNS is alive
For localhost, one second should be plenty Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -434,7 +434,7 @@ sub show_nameservers () {
|
||||
#
|
||||
# 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");
|
||||
my $dns_status_ret = &check_nameserver("127.0.0.1", "$dns_test_server", "UDP", undef, "+timeout=1", "+retry=0");
|
||||
|
||||
if ($dns_status_ret eq "2") {
|
||||
$dns_status_string = "$Lang::tr{'working'}";
|
||||
@@ -841,8 +841,8 @@ sub red_is_active () {
|
||||
}
|
||||
|
||||
# Function to check a given nameserver against propper work.
|
||||
sub check_nameserver($$$$) {
|
||||
my ($nameserver, $record, $proto, $tls_hostname) = @_;
|
||||
sub check_nameserver($$$$$) {
|
||||
my ($nameserver, $record, $proto, $tls_hostname, @args) = @_;
|
||||
|
||||
# Check if the system is online.
|
||||
unless (&red_is_active()) {
|
||||
@@ -851,7 +851,7 @@ sub check_nameserver($$$$) {
|
||||
|
||||
# Default values.
|
||||
my @command = ("kdig", "+dnssec",
|
||||
"+bufsize=1232");
|
||||
"+bufsize=1232", @args);
|
||||
|
||||
# Handle different protols.
|
||||
if ($proto eq "TCP") {
|
||||
|
||||
Reference in New Issue
Block a user