add GeoIP and rDNS information to used nameservers
authorPeter Müller <peter.mueller@link38.eu>
Wed, 15 Nov 2017 21:49:00 +0000 (22:49 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 29 Nov 2017 12:05:43 +0000 (12:05 +0000)
Add GeoIP and rDNS information to DNS nameserver list at netexternal.cgi

Use newly implemented GeoIP function in /var/ipfire/geoip-functions.pl

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
doc/language_issues.es
doc/language_issues.fr
doc/language_issues.it
doc/language_issues.nl
doc/language_issues.pl
doc/language_issues.ru
doc/language_issues.tr
doc/language_missings
html/cgi-bin/netexternal.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index 868ba71..f030fda 100644 (file)
@@ -1115,6 +1115,7 @@ WARNING: untranslated string: proxy reports today
 WARNING: untranslated string: proxy reports weekly
 WARNING: untranslated string: qos enter bandwidths
 WARNING: untranslated string: random number generator daemon
+WARNING: untranslated string: rdns
 WARNING: untranslated string: red1
 WARNING: untranslated string: required field
 WARNING: untranslated string: route config changed
index a0930c3..2c5fc31 100644 (file)
@@ -1127,6 +1127,7 @@ WARNING: untranslated string: proxy reports today
 WARNING: untranslated string: proxy reports weekly
 WARNING: untranslated string: qos enter bandwidths
 WARNING: untranslated string: random number generator daemon
+WARNING: untranslated string: rdns
 WARNING: untranslated string: red1
 WARNING: untranslated string: required field
 WARNING: untranslated string: route config changed
index f8475d9..805bc12 100644 (file)
@@ -859,6 +859,7 @@ WARNING: untranslated string: ovpn add conf
 WARNING: untranslated string: pptp netconfig
 WARNING: untranslated string: pptp peer
 WARNING: untranslated string: pptp route
+WARNING: untranslated string: rdns
 WARNING: untranslated string: required field
 WARNING: untranslated string: route config changed
 WARNING: untranslated string: routing config added
index 9813b91..6567084 100644 (file)
@@ -900,6 +900,7 @@ WARNING: untranslated string: pptp netconfig
 WARNING: untranslated string: pptp peer
 WARNING: untranslated string: pptp route
 WARNING: untranslated string: random number generator daemon
+WARNING: untranslated string: rdns
 WARNING: untranslated string: required field
 WARNING: untranslated string: route config changed
 WARNING: untranslated string: routing config added
index 868ba71..f030fda 100644 (file)
@@ -1115,6 +1115,7 @@ WARNING: untranslated string: proxy reports today
 WARNING: untranslated string: proxy reports weekly
 WARNING: untranslated string: qos enter bandwidths
 WARNING: untranslated string: random number generator daemon
+WARNING: untranslated string: rdns
 WARNING: untranslated string: red1
 WARNING: untranslated string: required field
 WARNING: untranslated string: route config changed
index 1b67fd2..68e7b93 100644 (file)
@@ -1111,6 +1111,7 @@ WARNING: untranslated string: proxy reports today
 WARNING: untranslated string: proxy reports weekly
 WARNING: untranslated string: qos enter bandwidths
 WARNING: untranslated string: random number generator daemon
+WARNING: untranslated string: rdns
 WARNING: untranslated string: red1
 WARNING: untranslated string: required field
 WARNING: untranslated string: route config changed
index 01334e2..b4f6279 100644 (file)
@@ -800,6 +800,7 @@ WARNING: untranslated string: one hour
 WARNING: untranslated string: one month
 WARNING: untranslated string: one week
 WARNING: untranslated string: one year
+WARNING: untranslated string: rdns
 WARNING: untranslated string: route config changed
 WARNING: untranslated string: routing config added
 WARNING: untranslated string: routing config changed
index 68d801c..80ea6a6 100644 (file)
 < proxy reports weekly
 < qos enter bandwidths
 < random number generator daemon
+< rdns
 < red1
 < required field
 < samba join a domain
 < proxy reports weekly
 < qos enter bandwidths
 < random number generator daemon
+< rdns
 < red1
 < required field
 < samba join a domain
 < proxy reports weekly
 < qos enter bandwidths
 < random number generator daemon
+< rdns
 < red1
 < required field
 < samba join a domain
 < proxy reports weekly
 < qos enter bandwidths
 < random number generator daemon
+< rdns
 < red1
 < required field
 < samba join a domain
index 299612d..4393393 100644 (file)
@@ -25,9 +25,12 @@ use strict;
 #use warnings;
 #use CGI::Carp 'fatalsToBrowser';
 
+use IO::Socket;
+
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
+require "${General::swroot}/geoip-functions.pl";
 require "${General::swroot}/graphs.pl";
 
 my %color = ();
@@ -98,6 +101,12 @@ if ( $querry[0] ne~ ""){
                                        <th align="center">
                                                <strong>$Lang::tr{'nameserver'}</strong>
                                        </th>
+                                       <th align="center">
+                                               <strong>$Lang::tr{'country'}</strong>
+                                       </th>
+                                       <th align="center">
+                                               <strong>$Lang::tr{'rdns'}</strong>
+                                       </th>
                                        <th align="center">
                                                <strong>$Lang::tr{'status'}</strong>
                                        </th>
@@ -139,9 +148,25 @@ END
 
                my $table_colour = ($id++ % 2) ? $color{'color22'} : $color{'color20'};
 
+               # collect more information about name server (rDNS, GeoIP country code)
+               my $ccode = &GeoIP::lookup($nameserver);
+               my $flag_icon = &GeoIP::get_flag_icon($ccode);
+
+               my $iaddr = inet_aton($nameserver);
+               my $rdns = gethostbyaddr($iaddr, AF_INET);
+               if (!$rdns) { $rdns = $Lang::tr{'lookup failed'}; }
+
                print <<END;
                        <tr bgcolor="$table_colour">
-                               <td>$nameserver</td>
+                               <td>
+                                       $nameserver
+                               </td>
+                               <td align="center">
+                                       <a href='country.cgi#$ccode'><img src="$flag_icon" border="0" alt="$ccode" title="$ccode" /></a>
+                               </td>
+                               <td align="center">
+                                       $rdns
+                               </td>
                                <td bgcolor="$bgcolour" align="center">
                                        <font color="$colour"><strong>$message</strong></font>
                                </td>
index 672b965..92bf6f8 100644 (file)
 'quick playlist' => 'Quick Playlist',
 'ram' => 'RAM-Speicher',
 'random number generator daemon' => 'Random Number Generator Daemon',
+'rdns' => 'rDNS',
 'read bytes' => 'Gelesene Bytes',
 'read list' => 'Liste der Leseberechtigten',
 'real address' => 'Reale Addresse',
index b3120dc..44696f8 100644 (file)
 'quick playlist' => 'Quick Playlist',
 'ram' => 'RAM',
 'random number generator daemon' => 'Random Number Generator Daemon',
+'rdns' => 'rDNS',
 'read bytes' => 'Read Bytes',
 'read list' => 'list with readonly hosts',
 'real address' => 'Real Address',