summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-08-12 11:46:58 +0000
committerErmal <eri@pfsense.org>2011-08-12 11:47:12 +0000
commit6c86a39f8efc2906f53dafe57b304ed8b3241e84 (patch)
tree00885ffabe8c88272fb729943e075eb567192f34
parentf61dc8e6d638949866fdcb61c05c9d5905a48a80 (diff)
downloadpfsense-6c86a39f8efc2906f53dafe57b304ed8b3241e84.zip
pfsense-6c86a39f8efc2906f53dafe57b304ed8b3241e84.tar.gz
Allow disabling having localhost in resolv.conf. There are some special setups that might need this.
-rw-r--r--etc/inc/system.inc3
-rw-r--r--usr/local/www/system_advanced_misc.php22
2 files changed, 24 insertions, 1 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index c8f13d2..aad98e4 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -90,7 +90,8 @@ function system_resolvconf_generate($dynupdate = false) {
if($syscfg['domain'])
$resolvconf = "domain {$syscfg['domain']}\n";
- $resolvconf .= "nameserver 127.0.0.1\n";
+ if (!isset($config['system']['dnslocalhost']))
+ $resolvconf .= "nameserver 127.0.0.1\n";
if (isset($syscfg['dnsallowoverride'])) {
/* get dynamically assigned DNS servers (if any) */
diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php
index c418505..eda90d6 100644
--- a/usr/local/www/system_advanced_misc.php
+++ b/usr/local/www/system_advanced_misc.php
@@ -65,6 +65,7 @@ $pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
$pconfig['glxsb_enable'] = isset($config['system']['glxsb_enable']);
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
$pconfig['kill_states'] = isset($config['system']['kill_states']);
+$pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']);
if ($_POST) {
@@ -158,9 +159,15 @@ if ($_POST) {
else
unset($config['system']['kill_states']);
+ if($_POST['dnslocalhost'] == "yes")
+ $config['system']['dnslocalhost'] = true;
+ else
+ unset($config['system']['dnslocalhost']);
+
write_config();
$retval = 0;
+ system_resolvconf_generate(true);
$retval = filter_configure();
if(stristr($retval, "error") <> true)
$savemsg = get_std_save_message(gettext($retval));
@@ -391,6 +398,21 @@ function maxmss_checked(obj) {
<td colspan="2" class="list" height="12">&nbsp;</td>
</tr>
<tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("DNS Forwarder"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Localhost"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="dnslocalhost" type="checkbox" id="dnslocalhost" value="yes" <?php if ($pconfig['dnslocalhost']) echo "checked"; ?> />
+ <br />
+ <?=gettext("By default localhost(127.0.0.1) will be used as the first dns server. ".
+ "This option allows to override this setting by not including localhost in the list of dns servers."); ?>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" class="list" height="12">&nbsp;</td>
+ </tr>
+ <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Gateway Monitoring"); ?></td>
</tr>
<tr>
OpenPOWER on IntegriCloud