diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 40ebce0b351..7393ca2a019 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -153,6 +153,11 @@ function system_resolvconf_generate($dynupdate = false) {
$resolvconf .= "options edns0\n";
}
+ // Add options
+ if (isset($config['system']['resolvconfoptions']) && !empty($config['system']['resolvconfoptions'])) {
+ $resolvconf .= base64_decode($config['system']['resolvconfoptions']);
+ }
+
$dnslock = lock('resolvconf', LOCK_EX);
$fd = fopen("{$g['etc_path']}/resolv.conf", "w");
diff --git a/src/usr/local/www/system_advanced_network.php b/src/usr/local/www/system_advanced_network.php
index 90577cf6d86..b90c1936c06 100644
--- a/src/usr/local/www/system_advanced_network.php
+++ b/src/usr/local/www/system_advanced_network.php
@@ -50,6 +50,7 @@
$pconfig['disablesegmentationoffloading'] = isset($config['system']['disablesegmentationoffloading']);
$pconfig['disablelargereceiveoffloading'] = isset($config['system']['disablelargereceiveoffloading']);
$pconfig['ip_change_kill_states'] = isset($config['system']['ip_change_kill_states']) ? $config['system']['ip_change_kill_states'] : null;
+$pconfig['resolvconfoptions'] = isset($config['system']['resolvconfoptions']) ? base64_decode($config['system']['resolvconfoptions']) : '';
if ($_POST) {
@@ -173,6 +174,13 @@
unset($config['system']['ip_change_kill_states']);
}
+ if (!empty(trim($_POST['resolvconfoptions']))) {
+ $config['system']['resolvconfoptions'] = base64_encode(trim($_POST['resolvconfoptions']));
+ } else {
+ unset($config['system']['resolvconfoptions']);
+ }
+
+
setup_microcode();
// Write out configuration (config.xml)
@@ -406,6 +414,18 @@
}
$form->add($section);
+
+// section resolv.conf options
+$section = new Form_Section('Add persistent resolv.conf configuration options');
+
+$section->addInput(new Form_Textarea(
+ 'resolvconfoptions',
+ 'Add configuration options',
+ $pconfig['resolvconfoptions']
+))->setHelp('You can add persistent configuration options here.
Lines will be added at the end of the /etc/resolv.conf file.
Example (man resolv.conf):
options timeout:1
options attempts:1');
+
+$form->add($section);
+
print $form;
?>