diff options
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 1ee4c0e..f714fe1 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -148,6 +148,7 @@ function system_hosts_generate() { $syscfg = $config['system']; $lancfg = $config['interfaces']['lan']; + $lancfgip = get_interface_ip("lan"); $dnsmasqcfg = $config['dnsmasq']; if (!is_array($dnsmasqcfg['hosts'])) { @@ -163,7 +164,11 @@ function system_hosts_generate() { $hosts = <<<EOD 127.0.0.1 localhost localhost.{$syscfg['domain']} -{$lancfg['ipaddr']} {$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']} + +EOD; + if (is_ipaddr($lancfgip)) + $hosts .= <<<EOD +{$lancfgip} {$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']} EOD; @@ -1124,4 +1129,4 @@ function enable_watchdog() { } } -?>
\ No newline at end of file +?> |