aboutsummaryrefslogtreecommitdiffstats
path: root/config/bind
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2013-11-11 02:49:04 -0800
committerMarcello Coutinho <marcellocoutinho@gmail.com>2013-11-11 02:49:04 -0800
commit82e689694cd7362a275a99043de14c8359715e36 (patch)
tree6bda1dc4dbba246f8942f8e780783f5e4c8a4043 /config/bind
parente27e034ec6d8ef1011373ec5d1e479cbe906b111 (diff)
parent7bef8eca7511523919bbb2cb084e010d67c8fd94 (diff)
downloadpfsense-packages-82e689694cd7362a275a99043de14c8359715e36.tar.gz
pfsense-packages-82e689694cd7362a275a99043de14c8359715e36.tar.bz2
pfsense-packages-82e689694cd7362a275a99043de14c8359715e36.zip
Merge pull request #536 from jean-m-cyr/master
bind - optionally add static dhcp leases as zone A records
Diffstat (limited to 'config/bind')
-rw-r--r--config/bind/bind.inc15
-rw-r--r--config/bind/bind_zones.xml7
2 files changed, 21 insertions, 1 deletions
diff --git a/config/bind/bind.inc b/config/bind/bind.inc
index a288dcfb..146632c9 100644
--- a/config/bind/bind.inc
+++ b/config/bind/bind.inc
@@ -238,6 +238,9 @@ EOD;
$bind_conf .="\t\t};\n\n";
}
}
+ else {
+ $bind_conf .="\t\tlogging { category default { null; }; };\n\n";
+ }
#Config Zone domain
if(!is_array($config["installedpackages"]["bindacls"]) || !is_array($config["installedpackages"]["bindacls"]["config"])){
@@ -435,6 +438,14 @@ EOD;
$zone_conf .= "$hostname \t IN $hosttype $hostvalue \t$hostdst\n";
}
+ if (($zone[regdhcpstatic] == 'on') && is_array($config['dhcpd'])) {
+ foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf)
+ if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable']))
+ foreach ($dhcpifconf['staticmap'] as $host)
+ if ($host['ipaddr'] && $host['hostname']) {
+ $zone_conf .= "{$host['hostname']}\tIN A\t{$host['ipaddr']}\n";
+ }
+ }
if ($zone['customzonerecords']!=""){
$zone_conf .= "\n\n;\n;custom zone records\n;\n".base64_decode($zone['customzonerecords'])."\n";
}
@@ -609,6 +620,7 @@ function bind_print_javascript_type_zone(){
document.iform.forwarders.disabled = 1;
document.iform.dnssec.disabled = 0;
document.iform.backupkeys.disabled = 0;
+ document.iform.regdhcpstatic.disabled = 0;
document.iform.ipns.disabled = 0;
document.iform.mail.disabled = 0;
document.iform.serial.disabled = 0;
@@ -625,6 +637,7 @@ function bind_print_javascript_type_zone(){
document.iform.forwarders.disabled = 1;
document.iform.dnssec.disabled = 0;
document.iform.backupkeys.disabled = 0;
+ document.iform.regdhcpstatic.disabled = 0;
document.iform.ipns.disabled = 1;
document.iform.mail.disabled = 1;
document.iform.serial.disabled = 1;
@@ -641,6 +654,7 @@ function bind_print_javascript_type_zone(){
document.iform.forwarders.disabled = 0;
document.iform.dnssec.disabled = 1;
document.iform.backupkeys.disabled = 1;
+ document.iform.regdhcpstatic.disabled = 1;
document.iform.ipns.disabled = 1;
document.iform.mail.disabled = 1;
document.iform.serial.disabled = 1;
@@ -657,6 +671,7 @@ function bind_print_javascript_type_zone(){
document.iform.forwarders.disabled = 1;
document.iform.dnssec.disabled = 1;
document.iform.backupkeys.disabled = 1;
+ document.iform.regdhcpstatic.disabled = 1;
document.iform.ipns.disabled = 1;
document.iform.mail.disabled = 0;
document.iform.serial.disabled = 0;
diff --git a/config/bind/bind_zones.xml b/config/bind/bind_zones.xml
index 77893417..d5cbe1b8 100644
--- a/config/bind/bind_zones.xml
+++ b/config/bind/bind_zones.xml
@@ -72,7 +72,6 @@
<tab>
<text>Zones</text>
<url>/pkg.php?xml=bind_zones.xml&amp;id=0</url>
- <active/>
</tab>
<tab>
<text>Sync</text>
@@ -385,6 +384,12 @@
</rowhelper>
</field>
<field>
+ <fieldname>regdhcpstatic</fieldname>
+ <fielddescr>Register DHCP static mappings</fielddescr>
+ <description>If this option is set, then DHCP static mappings will be registered in DNS, so that their name can be resolved.</description>
+ <type>checkbox</type>
+ </field>
+ <field>
<type>listtopic</type>
<name>Custom Zone Domain records</name>
<fieldname>temp02</fieldname>