From 84e59c9efa6d403bbbcfa2db265fd9555e7c4f7e Mon Sep 17 00:00:00 2001 From: jdegraeve Date: Mon, 30 Jan 2006 10:03:45 +0000 Subject: [PATCH] Add a tertiary dns server to allow failure of the primary and secondary. This behavior can be necessary in certain cases where the first 2 dns servers are behind the same firewall. git-svn-id: https://svn.m0n0.ch/wall/trunk@47 e36fee2c-cc09-0410-a7cc-ebac5c6737de --- webgui/system.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/webgui/system.php b/webgui/system.php index c7f8265..b0c68ee 100644 --- a/webgui/system.php +++ b/webgui/system.php @@ -34,7 +34,7 @@ require("guiconfig.inc"); $pconfig['hostname'] = $config['system']['hostname']; $pconfig['domain'] = $config['system']['domain']; -list($pconfig['dns1'],$pconfig['dns2']) = $config['system']['dnsserver']; +list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3']) = $config['system']['dnsserver']; $pconfig['dnsallowoverride'] = isset($config['system']['dnsallowoverride']); $pconfig['username'] = $config['system']['username']; if (!$pconfig['username']) @@ -79,8 +79,8 @@ if ($_POST) { if ($_POST['domain'] && !is_domain($_POST['domain'])) { $input_errors[] = "The domain may only contain the characters a-z, 0-9, '-' and '.'."; } - if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) { - $input_errors[] = "A valid IP address must be specified for the primary/secondary DNS server."; + if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2'])) || ($_POST['dns3'] && !is_ipaddr($_POST['dns3']))) { + $input_errors[] = "A valid IP address must be specified for the primary/secondary/tertiary DNS server."; } if ($_POST['username'] && !preg_match("/^[a-zA-Z0-9]*$/", $_POST['username'])) { $input_errors[] = "The username may only contain the characters a-z, A-Z and 0-9."; @@ -120,6 +120,8 @@ if ($_POST) { $config['system']['dnsserver'][] = $_POST['dns1']; if ($_POST['dns2']) $config['system']['dnsserver'][] = $_POST['dns2']; + if ($_POST['dns3']) + $config['system']['dnsserver'][] = $_POST['dns3']; $olddnsallowoverride = $config['system']['dnsallowoverride']; $config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false; @@ -177,7 +179,9 @@ if ($_POST) {
- + +
+
IP addresses; these are also used for the DHCP service, DNS forwarder and for PPTP VPN clients
-- 2.43.0