diff options
author | Andrew Thompson <andrew@clonedev.co.nz> | 2011-07-12 15:35:14 +1200 |
---|---|---|
committer | Andrew Thompson <andrew@clonedev.co.nz> | 2011-07-13 10:22:26 +1200 |
commit | f7c7eecb32bb3e95b01fd3a4cf9dc5552bf64e19 (patch) | |
tree | 2ae858e8d99091fbc39b99254fa6b685874f22d9 /etc/inc/system.inc | |
parent | c317af993701a9fbb91b9f00a53ceaaf637afb4c (diff) | |
download | pfsense-f7c7eecb32bb3e95b01fd3a4cf9dc5552bf64e19.zip pfsense-f7c7eecb32bb3e95b01fd3a4cf9dc5552bf64e19.tar.gz |
Allow DHCP mappings to be resolved first for reverse lookups.
This was affecting a kerberos installation where the first DNS alias was
given for the PTR instead of the static DHCP mapping name, breaking the
kerberos tokens.
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 0d9a9fd..6cbe587 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -228,6 +228,8 @@ function system_hosts_generate() { $hostscfg = $dnsmasqcfg['hosts']; $hosts = "127.0.0.1 localhost localhost.{$syscfg['domain']}\n"; + $lhosts = ""; + $dhosts = ""; if ($config['interfaces']['lan']) { $cfgip = get_interface_ip("lan"); @@ -248,18 +250,23 @@ function system_hosts_generate() { foreach ($hostscfg as $host) { if ($host['host']) - $hosts .= "{$host['ip']} {$host['host']}.{$host['domain']} {$host['host']}\n"; + $lhosts .= "{$host['ip']} {$host['host']}.{$host['domain']} {$host['host']}\n"; else - $hosts .= "{$host['ip']} {$host['domain']}\n"; + $lhosts .= "{$host['ip']} {$host['domain']}\n"; } if (isset($dnsmasqcfg['regdhcpstatic']) && 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']) - $hosts .= "{$host['ipaddr']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n"; + $dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n"; } + if (isset($dnsmasqcfg['dhcpfirst'])) + $hosts .= $dhosts . $lhosts; + else + $hosts .= $lhosts . $dhosts; + /* * Do not remove this because dhcpleases monitors with kqueue it needs to be * killed before writing to hosts files. |