diff options
author | jim-p <jimp@pfsense.org> | 2017-08-14 14:16:53 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2017-08-14 14:16:53 -0400 |
commit | 0e78c2f544ad577234a0a2f87ce2e8caefdfdb77 (patch) | |
tree | 720f3e284a048c65fe46bd3f362b0307f6941aa6 /src/etc/inc | |
parent | fde09aa8e52205b446f3a61b482a748dafdd0a1d (diff) | |
download | pfsense-0e78c2f544ad577234a0a2f87ce2e8caefdfdb77.zip pfsense-0e78c2f544ad577234a0a2f87ce2e8caefdfdb77.tar.gz |
Put the FQDN first in /etc/hosts to make dnsmasq happy when reverse resolving hostnames. Make a special exception for localhost. Fixes #7771
Diffstat (limited to 'src/etc/inc')
-rw-r--r-- | src/etc/inc/system.inc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index b6b1444..295641d 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -549,10 +549,11 @@ function system_hosts_generate() { $hosts_array = system_hosts_entries($dnsmasqcfg); foreach ($hosts_array as $host) { $hosts .= "{$host['ipaddr']}\t"; - if (!empty($host['name'])) { - $hosts .= "{$host['name']} "; + if ($host['name'] == "localhost") { + $hosts .= "{$host['name']} {$host['fqdn']}"; + } else { + $hosts .= "{$host['fqdn']} {$host['name']}"; } - $hosts .= "{$host['fqdn']}"; $hosts .= "\n"; } unset($hosts_array); |