DNS Forwarding: Allow passing multiple name servers (separated by comma)
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Dec 2018 19:42:46 +0000 (20:42 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Dec 2018 19:42:46 +0000 (20:42 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
13 files changed:
doc/language_issues.de
doc/language_issues.en
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/dnsforward.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index e2048d7..6b770e5 100644 (file)
@@ -706,6 +706,7 @@ WARNING: untranslated string: bytes = unknown string
 WARNING: untranslated string: captive = unknown string
 WARNING: untranslated string: community rules = Snort/VRT GPLv2 Community Rules
 WARNING: untranslated string: dead peer detection = Dead Peer Detection
+WARNING: untranslated string: dnsforward forward_server = unknown string
 WARNING: untranslated string: emerging rules = Emergingthreats.net Community Rules
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
 WARNING: untranslated string: fwhost err hostip = unknown string
index 228b685..392490c 100644 (file)
@@ -650,7 +650,8 @@ WARNING: untranslated string: dnsforward add a new entry = Add a new entry
 WARNING: untranslated string: dnsforward configuration = DNS forward configuration
 WARNING: untranslated string: dnsforward edit an entry = Edit an existing entry
 WARNING: untranslated string: dnsforward entries = Current entries
-WARNING: untranslated string: dnsforward forward_server = Nameserver
+WARNING: untranslated string: dnsforward forward_server = unknown string
+WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: dnsforward zone = Zone
 WARNING: untranslated string: dnssec aware = DNSSEC Aware
 WARNING: untranslated string: dnssec disabled warning = WARNING: DNSSEC has been disabled
index 0131597..581b99a 100644 (file)
@@ -755,7 +755,8 @@ WARNING: untranslated string: dnsforward add a new entry = Add a new entry
 WARNING: untranslated string: dnsforward configuration = DNS forward configuration
 WARNING: untranslated string: dnsforward edit an entry = Edit an existing entry
 WARNING: untranslated string: dnsforward entries = Current entries
-WARNING: untranslated string: dnsforward forward_server = Nameserver
+WARNING: untranslated string: dnsforward forward_server = unknown string
+WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: dnsforward zone = Zone
 WARNING: untranslated string: dnssec aware = DNSSEC Aware
 WARNING: untranslated string: dnssec disabled warning = WARNING: DNSSEC has been disabled
index 3fd7f35..368f666 100644 (file)
@@ -742,6 +742,7 @@ WARNING: untranslated string: Captive clients = unknown string
 WARNING: untranslated string: Scan for Songs = unknown string
 WARNING: untranslated string: bytes = unknown string
 WARNING: untranslated string: captive = unknown string
+WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
 WARNING: untranslated string: fwhost err hostip = unknown string
 WARNING: untranslated string: guardian block a host = unknown string
index 1a1b283..010b6ce 100644 (file)
@@ -766,6 +766,7 @@ WARNING: untranslated string: dhcp dns update = DNS Update
 WARNING: untranslated string: dhcp dns update algo = Algorithm:
 WARNING: untranslated string: dhcp dns update secret = Secret:
 WARNING: untranslated string: dl client arch insecure = Download insecure Client Package (zip)
+WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: dnssec disabled warning = WARNING: DNSSEC has been disabled
 WARNING: untranslated string: eight hours = 8 Hours
 WARNING: untranslated string: email config = Configuration
index 0de2a0f..336a75a 100644 (file)
@@ -772,6 +772,7 @@ WARNING: untranslated string: dhcp dns update algo = Algorithm:
 WARNING: untranslated string: dhcp dns update secret = Secret:
 WARNING: untranslated string: dl client arch insecure = Download insecure Client Package (zip)
 WARNING: untranslated string: dns servers = DNS Servers
+WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: dnssec aware = DNSSEC Aware
 WARNING: untranslated string: dnssec disabled warning = WARNING: DNSSEC has been disabled
 WARNING: untranslated string: dnssec information = DNSSEC Information
index 0131597..581b99a 100644 (file)
@@ -755,7 +755,8 @@ WARNING: untranslated string: dnsforward add a new entry = Add a new entry
 WARNING: untranslated string: dnsforward configuration = DNS forward configuration
 WARNING: untranslated string: dnsforward edit an entry = Edit an existing entry
 WARNING: untranslated string: dnsforward entries = Current entries
-WARNING: untranslated string: dnsforward forward_server = Nameserver
+WARNING: untranslated string: dnsforward forward_server = unknown string
+WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: dnsforward zone = Zone
 WARNING: untranslated string: dnssec aware = DNSSEC Aware
 WARNING: untranslated string: dnssec disabled warning = WARNING: DNSSEC has been disabled
index ca75c0b..ae25fb2 100644 (file)
@@ -759,7 +759,8 @@ WARNING: untranslated string: dnsforward add a new entry = Add a new entry
 WARNING: untranslated string: dnsforward configuration = DNS forward configuration
 WARNING: untranslated string: dnsforward edit an entry = Edit an existing entry
 WARNING: untranslated string: dnsforward entries = Current entries
-WARNING: untranslated string: dnsforward forward_server = Nameserver
+WARNING: untranslated string: dnsforward forward_server = unknown string
+WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: dnsforward zone = Zone
 WARNING: untranslated string: dnssec aware = DNSSEC Aware
 WARNING: untranslated string: dnssec disabled warning = WARNING: DNSSEC has been disabled
index 6a79d65..38d8a3f 100644 (file)
@@ -743,6 +743,7 @@ WARNING: untranslated string: bytes = unknown string
 WARNING: untranslated string: captive = unknown string
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
+WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: fwdfw all subnets = All subnets
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
 WARNING: untranslated string: fwhost err hostip = unknown string
index 56219c5..84e955d 100644 (file)
 < dnsforward configuration
 < dnsforward edit an entry
 < dnsforward entries
-< dnsforward forward_server
+< dnsforward forward_servers
 < dnsforward zone
 < dnssec aware
 < dnssec disabled warning
 ############################################################################
 # Checking cgi-bin translations for language: fr                           #
 ############################################################################
+< dnsforward forward_servers
 < ovpn warning rfc3280
 < wlanap neighbor scan
 < wlanap neighbor scan warning
 < dhcp dns update algo
 < dhcp dns update secret
 < dl client arch insecure
+< dnsforward forward_servers
 < dnssec disabled warning
 < eight hours
 < email config
 < dh name is invalid
 < dh parameter
 < dl client arch insecure
+< dnsforward forward_servers
 < dnssec aware
 < dnssec disabled warning
 < dnssec information
 < dnsforward configuration
 < dnsforward edit an entry
 < dnsforward entries
-< dnsforward forward_server
+< dnsforward forward_servers
 < dnsforward zone
 < dnssec aware
 < dnssec disabled warning
 < dnsforward configuration
 < dnsforward edit an entry
 < dnsforward entries
-< dnsforward forward_server
+< dnsforward forward_servers
 < dnsforward zone
 < dnssec aware
 < dnssec disabled warning
 ############################################################################
 < crypto error
 < crypto warning
+< dnsforward forward_servers
 < fwdfw all subnets
 < ovpn error dh
 < ovpn error md5
index ee63c6d..9091ee1 100644 (file)
@@ -50,7 +50,7 @@ my %mainsettings = ();
 $cgiparams{'ENABLED'} = 'off';
 $cgiparams{'ACTION'} = '';
 $cgiparams{'ZONE'} = '';
-$cgiparams{'FORWARD_SERVER'} = '';
+$cgiparams{'FORWARD_SERVERS'} = '';
 $cgiparams{'REMARK'} ='';
 &Header::getcgihash(\%cgiparams);
 open(FILE, $filename) or die 'Unable to open config file.';
@@ -67,14 +67,21 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'add'})
                $errormessage = $Lang::tr{'invalid domain name'};
        }
 
-       # Check if the settings for the forward server are valid.
-       unless(&General::validip($cgiparams{'FORWARD_SERVER'})) {
-               $errormessage = $Lang::tr{'invalid ip'};
+       my @forward_servers = split(/\,/, $cgiparams{'FORWARD_SERVERS'});
+       foreach my $forward_server (@forward_servers) {
+               # Check if the settings for the forward server are valid.
+               unless(&General::validip($forward_server)) {
+                       $errormessage = "$Lang::tr{'invalid ip'}: $forward_server";
+                       last;
+               }
        }
 
        # Go further if there was no error.
        if ( ! $errormessage)
        {
+               # Save servers separated by |
+               $cgiparams{'FORWARD_SERVERS'} = join("|", @forward_servers);
+
            # Check if a remark has been entered.
            $cgiparams{'REMARK'} = &Header::cleanhtml($cgiparams{'REMARK'});
 
@@ -82,7 +89,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'add'})
                if($cgiparams{'EDITING'} eq 'no') {
                        open(FILE,">>$filename") or die 'Unable to open config file.';
                        flock FILE, 2;
-                       print FILE "$cgiparams{'ENABLED'},$cgiparams{'ZONE'},$cgiparams{'FORWARD_SERVER'},$cgiparams{'REMARK'}\n";
+                       print FILE "$cgiparams{'ENABLED'},$cgiparams{'ZONE'},$cgiparams{'FORWARD_SERVERS'},$cgiparams{'REMARK'}\n";
                } else {
                        open(FILE, ">$filename") or die 'Unable to open config file.';
                        flock FILE, 2;
@@ -91,7 +98,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'add'})
                        {
                                $id++;
                                if ($cgiparams{'EDITING'} eq $id) {
-                                       print FILE "$cgiparams{'ENABLED'},$cgiparams{'ZONE'},$cgiparams{'FORWARD_SERVER'},$cgiparams{'REMARK'}\n";
+                                       print FILE "$cgiparams{'ENABLED'},$cgiparams{'ZONE'},$cgiparams{'FORWARD_SERVERS'},$cgiparams{'REMARK'}\n";
                                } else { print FILE "$line"; }
                        }
                }
@@ -167,7 +174,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'edit'})
                        my @temp = split(/\,/,$line);
                        $cgiparams{'ENABLED'} = $temp[0];
                        $cgiparams{'ZONE'} = $temp[1];
-                       $cgiparams{'FORWARD_SERVER'} = $temp[2];
+                       $cgiparams{'FORWARD_SERVERS'} = join(",", split(/\|/, $temp[2]));
                        $cgiparams{'REMARK'} = $temp[3];
                }
        }
@@ -214,7 +221,7 @@ print <<END
 
        <tr>
                <td width='20%' class='base'>$Lang::tr{'dnsforward forward_server'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
-               <td><input type='text' name='FORWARD_SERVER' value='$cgiparams{'FORWARD_SERVER'}' size='24' /></td>
+               <td><input type='text' name='FORWARD_SERVERS' value='$cgiparams{'FORWARD_SERVERS'}' size='24' /></td>
        </tr>
 </table>
 
@@ -255,7 +262,7 @@ print <<END
 <table width='100%' class='tbl'>
        <tr>
                <th width='35%' class='boldbase' align='center'><b>$Lang::tr{'dnsforward zone'}</b></th>
-               <th width='30%' class='boldbase' align='center'><b>$Lang::tr{'dnsforward forward_server'}</b></th>
+               <th width='30%' class='boldbase' align='center'><b>$Lang::tr{'dnsforward forward_servers'}</b></th>
                <th width='30%' class='boldbase' align='center'><b>$Lang::tr{'remark'}</b></th>
                <th width='5%' class='boldbase' colspan='3' align='center'><b>$Lang::tr{'action'}</b></th>
        </tr>
@@ -284,7 +291,10 @@ foreach my $line (@current)
        my $gif = '';
        my $gdesc = '';
        my $toggle = '';
-       
+
+       # Format lists of servers
+       my $servers = join(", ", split(/\|/, $temp[2]));
+
        if($cgiparams{'ACTION'} eq $Lang::tr{'edit'} && $cgiparams{'ID'} eq $id) {
                print "<tr>";
                $col="bgcolor='${Header::colouryellow}'"; }
@@ -303,7 +313,7 @@ foreach my $line (@current)
 #
 print <<END
        <td align='center' $col>$temp[1]</td>
-       <td align='center' $col>$temp[2]</td>
+       <td align='center' $col>$servers</td>
        <td align='center' $col>$temp[3]</td>
        <td align='center' $col>
                <form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
index 42eb141..a6fcfea 100644 (file)
 'dnsforward configuration' => 'Einstellungen für DNS Weiterleitung',
 'dnsforward edit an entry' => 'Existierenden Eintrag bearbeiten',
 'dnsforward entries' => 'Aktuelle Einträge',
-'dnsforward forward_server' => 'DNS-Server',
+'dnsforward forward_servers' => 'DNS-Server',
 'dnsforward zone' => 'Zone',
 'dnssec aware' => 'DNSSEC-Informationen verfügbar, aber nicht validierend',
 'dnssec disabled warning' => 'WARNUNG: DNSSEC wurde deaktiviert',
index e935640..5bbd0c3 100644 (file)
 'dnsforward configuration' => 'DNS forward configuration',
 'dnsforward edit an entry' => 'Edit an existing entry',
 'dnsforward entries' => 'Current entries',
-'dnsforward forward_server' => 'Nameserver',
+'dnsforward forward_servers' => 'Nameservers',
 'dnsforward zone' => 'Zone',
 'dnssec aware' => 'DNSSEC Aware',
 'dnssec disabled warning' => 'WARNING: DNSSEC has been disabled',