diff options
Diffstat (limited to 'packages/squid')
-rw-r--r-- | packages/squid/squid.inc | 20 | ||||
-rw-r--r-- | packages/squid/squid.xml | 4 |
2 files changed, 21 insertions, 3 deletions
diff --git a/packages/squid/squid.inc b/packages/squid/squid.inc index 05eb144e..674f38cd 100644 --- a/packages/squid/squid.inc +++ b/packages/squid/squid.inc @@ -312,6 +312,15 @@ function squid_validate_general($post, $input_errors) { $input_errors[] = "You can not enable forwarding traffic to private subnets to the proxy server without using the transparent proxy."; } + if(!empty($post['dns_nameservers'])) { + $altdns = explode(";", ($post['dns_nameservers'])); +// $conf .= "# Custom options\n"; + foreach ($altdns as $dnssrv) { +// $conf .= $custopt."\n"; + if (!is_ipaddr($dnssrv)) + $input_errors[] = 'You must enter a valid IP address in the \'Alternate DNS servers\' field'; + }} + } function squid_validate_upstream($post, $input_errors) { @@ -533,7 +542,16 @@ EOD; if ($settings['disable_xforward']) $conf .= "forwarded_for off\n"; if ($settings['disable_via']) $conf .= "via off\n"; $conf .= "uri_whitespace {$settings['uri_whitespace']}\n"; - if (!empty($settings['dns_nameservers'])) $conf .= "dns_nameservers {$settings['dns_nameservers']}\n"; + + if(!empty($settings['dns_nameservers'])) { + $altdns = explode(";", ($settings['dns_nameservers'])); + $conf .= "dns_nameservers "; + foreach ($altdns as $dnssrv) { + $conf .= $dnssrv." "; + } +// $conf .= "\n"; + } + return $conf; } diff --git a/packages/squid/squid.xml b/packages/squid/squid.xml index 9f138ed9..6bba018f 100644 --- a/packages/squid/squid.xml +++ b/packages/squid/squid.xml @@ -271,9 +271,9 @@ </options> </field> <field> - <fielddescr>Use different DNS-servers for the proxy-server</fielddescr> + <fielddescr>Use alternate DNS-servers for the proxy-server</fielddescr> <fieldname>dns_nameservers</fieldname> - <description>If you want to use other DNS-servers than the DNS-forwarder, enter the IPs here separated by spaces.</description> + <description>If you want to use other DNS-servers than the DNS-forwarder, enter the IPs here, separated by semi-colons (;).</description> <type>input</type> <size>60</size> </field> |