dns.cgi: Only perform reverse lookups if the system is online

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2020-01-08 10:35:24 +01:00
parent beebf925c3
commit 25dda4a082

View File

@@ -519,8 +519,13 @@ END
my $ccode = &GeoIP::lookup($nameserver);
my $flag_icon = &GeoIP::get_flag_icon($ccode);
my $iaddr = inet_aton($nameserver);
my $rdns = gethostbyaddr($iaddr, AF_INET);
my $rdns;
# Only do the reverse lookup if the system is online.
if ( -f "/var/ipfire/red/active") {
my $iaddr = inet_aton($nameserver);
$rdns = gethostbyaddr($iaddr, AF_INET);
}
if (!$rdns) { $rdns = $Lang::tr{'lookup failed'}; }