aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Wyatt <stuart@gogglespisano.com>2015-04-09 09:50:08 -0700
committerStuart Wyatt <stuart@gogglespisano.com>2015-04-09 09:50:08 -0700
commitfe0163a939023f87b259f3475a89ee632824a973 (patch)
treee014674f8e19736be8401d9a3a131cc35c0dd8d6
parent1bab1a2665febb7a9f69adccacda1e7dc92574ed (diff)
downloadpfsense-packages-fe0163a939023f87b259f3475a89ee632824a973.tar.gz
pfsense-packages-fe0163a939023f87b259f3475a89ee632824a973.tar.bz2
pfsense-packages-fe0163a939023f87b259f3475a89ee632824a973.zip
BIND - add support for named command line options -4 and -6
-4 and -6 restrict the resolver to use the IPv4 and IPv6 transports respectively. The option is needed for the cases such as when you have IPv6 enabled on the LAN, but the WAN does not support IPv6. Add a list of choices with IPv4+IPv6 (default), IPv4 (only) and IPv6 (only) If IPv4 is selected, -4 will be added to the command line If IPv6 is selected, -6 will be added to the command line
-rw-r--r--config/bind/bind.inc13
-rw-r--r--config/bind/bind.xml12
2 files changed, 20 insertions, 5 deletions
diff --git a/config/bind/bind.inc b/config/bind/bind.inc
index 747fdc27..ba8c5dfe 100644
--- a/config/bind/bind.inc
+++ b/config/bind/bind.inc
@@ -799,12 +799,15 @@ function bind_print_javascript_type_zone2()
function bind_write_rcfile()
{
+ global $config;
+ $bind = $config['installedpackages']['bind']['config'][0];
+ $ip_version = ($bind['bind_ip_version'] ? $bind['bind_ip_version'] : "");
$rc = array();
$BIND_LOCALBASE = "/usr/local";
$rc['file'] = 'named.sh';
$rc['start'] = <<<EOD
- if [ -z "`ps auxw | grep "[n]amed -c /etc/namedb/named.conf"|awk '{print $2}'`" ];then
- {$BIND_LOCALBASE}/sbin/named -c /etc/namedb/named.conf -u bind -t /cf/named/
+ if [ -z "`ps auxw | grep "[n]amed {$ip_version} -c /etc/namedb/named.conf"|awk '{print $2}'`" ];then
+ {$BIND_LOCALBASE}/sbin/named {$ip_version} -c /etc/namedb/named.conf -u bind -t /cf/named/
fi
EOD;
$rc['stop'] = <<<EOD
@@ -812,12 +815,12 @@ EOD;
sleep 2
EOD;
$rc['restart'] = <<<EOD
- if [ -z "`ps auxw | grep "[n]amed -c /etc/namedb/named.conf"|awk '{print $2}'`" ];then
- {$BIND_LOCALBASE}/sbin/named -c /etc/namedb/named.conf -u bind -t /cf/named/
+ if [ -z "`ps auxw | grep "[n]amed {$ip_version} -c /etc/namedb/named.conf"|awk '{print $2}'`" ];then
+ {$BIND_LOCALBASE}/sbin/named {$ip_version} -c /etc/namedb/named.conf -u bind -t /cf/named/
else
killall -9 named 2>/dev/null
sleep 3
- {$BIND_LOCALBASE}/sbin/named -c /etc/namedb/named.conf -u bind -t /cf/named/
+ {$BIND_LOCALBASE}/sbin/named {$ip_version} -c /etc/namedb/named.conf -u bind -t /cf/named/
fi
EOD;
conf_mount_rw();
diff --git a/config/bind/bind.xml b/config/bind/bind.xml
index 3b5d9ad2..c24bf351 100644
--- a/config/bind/bind.xml
+++ b/config/bind/bind.xml
@@ -143,6 +143,18 @@
<required/>
</field>
<field>
+ <fielddescr>IP Version</fielddescr>
+ <fieldname>bind_ip_version</fieldname>
+ <description><![CDATA[Select IP transport version.<br>
+ This controls which transports are used when resolving queries.]]></description>
+ <type>select</type>
+ <options>
+ <option><name>IPv4+IPv6</name><value></value></option>
+ <option><name>IPv4</name><value>-4</value></option>
+ <option><name>IPv6</name><value>-6</value></option>
+ </options>
+ </field>
+ <field>
<fielddescr>Listen on</fielddescr>
<fieldname>listenon</fieldname>
<description><![CDATA[Choose the interfaces on which to enable BIND.]]></description>