summaryrefslogtreecommitdiffstats
path: root/src/etc/inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2017-08-14 14:16:53 -0400
committerjim-p <jimp@pfsense.org>2017-08-14 14:16:53 -0400
commit0e78c2f544ad577234a0a2f87ce2e8caefdfdb77 (patch)
tree720f3e284a048c65fe46bd3f362b0307f6941aa6 /src/etc/inc
parentfde09aa8e52205b446f3a61b482a748dafdd0a1d (diff)
downloadpfsense-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.inc7
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);
OpenPOWER on IntegriCloud