summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2013-07-30 03:13:49 -0700
committerErmal Luçi <eri@pfsense.org>2013-07-30 03:13:49 -0700
commit39655e065d0a2c8c7759781d33466ac4030bdf14 (patch)
treee94503f68ff84ed2ce2a1f52ef33c93e55789d6c
parent4e8eec4c3c4fb395a90523ca47360550a1400d04 (diff)
parent6ed5c06bc8ec67804b17a5709e65a3789000492b (diff)
downloadpfsense-39655e065d0a2c8c7759781d33466ac4030bdf14.zip
pfsense-39655e065d0a2c8c7759781d33466ac4030bdf14.tar.gz
Merge pull request #746 from razzfazz/dhcp-domain-releng-2-1
use correct domain names when registering static DHCP entries in DNS
-rw-r--r--etc/inc/system.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 75ee8f9..7e59a59 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -276,14 +276,22 @@ function system_hosts_generate() {
foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf)
if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable']))
foreach ($dhcpifconf['staticmap'] as $host)
- if ($host['ipaddr'] && $host['hostname'])
+ if ($host['ipaddr'] && $host['hostname'] && $host['domain'])
+ $dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$host['domain']} {$host['hostname']}\n";
+ else if ($host['ipaddr'] && $host['hostname'] && $dhcpifconf['domain'])
+ $dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$dhcpifconf['domain']} {$host['hostname']}\n";
+ else if ($host['ipaddr'] && $host['hostname'])
$dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n";
}
if (isset($dnsmasqcfg['regdhcpstatic']) && is_array($config['dhcpdv6'])) {
foreach ($config['dhcpdv6'] as $dhcpif => $dhcpifconf)
if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable']))
foreach ($dhcpifconf['staticmap'] as $host)
- if ($host['ipaddrv6'] && $host['hostname'])
+ if ($host['ipaddrv6'] && $host['hostname'] && $host['domain'])
+ $dhosts .= "{$host['ipaddrv6']} {$host['hostname']}.{$host['domain']} {$host['hostname']}\n";
+ else if ($host['ipaddrv6'] && $host['hostname'] && $dhcpifconf['domain'])
+ $dhosts .= "{$host['ipaddrv6']} {$host['hostname']}.{$dhcpifconf['domain']} {$host['hostname']}\n";
+ else if ($host['ipaddrv6'] && $host['hostname'])
$dhosts .= "{$host['ipaddrv6']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n";
}
OpenPOWER on IntegriCloud