summaryrefslogtreecommitdiffstats
path: root/src
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:17:36 -0400
commitde7d6cb87d600c6e093aa3e9f76246fe62824ac7 (patch)
treea63db59c9213674ddcfdb01559bb0049c5abee62 /src
parent8dce797c3b6f19853b2d175a5c1f483ad3e925b5 (diff)
downloadpfsense-de7d6cb87d600c6e093aa3e9f76246fe62824ac7.zip
pfsense-de7d6cb87d600c6e093aa3e9f76246fe62824ac7.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
(cherry picked from commit 0e78c2f544ad577234a0a2f87ce2e8caefdfdb77)
Diffstat (limited to 'src')
-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 f3f9520..8fc0edd 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -583,10 +583,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