Opened 22 months ago

Closed 6 months ago

#1606 closed feature_request (invalid)

dhcp uses 127.0.0.1 as a nameserver on external nic and passes it to clients

Reported by: anonymous Owned by:
Priority: normal Milestone: Get compiling & installing
Component: global Version: head
Severity: normal Keywords:
Cc:

Description

When I enable dhcp on the external interface (eth0 in my case) I get 127.0.0.1 as the first nameserver and my client pc also get that as the nameserver. The lease entry in /var/lib/dhcp3/dhclient.eth0.leases on the core gets an entry like:

option domain-name-servers 127.0.0.1,193.8.10.10,193.8.1.1;

maybe it needs to filter out the invalid 127.0.0.1 address? When I manually remove the 127.0.0.1 entry from resolv.conf it works properly.

Change History (4)

comment:1 follow-up: Changed 22 months ago by pos

  • Component changed from unknown to global
  • Milestone changed from 1004 to Get compiling & installing
  • Type changed from defect to feature_request
  • Version changed from 1004 to head

At the moment we support dhcp on the internal interface only.

comment:2 in reply to: ↑ 1 Changed 21 months ago by anonymous

Replying to pos:

At the moment we support dhcp on the internal interface only.

I think we got a misunderstanding here. I am talking about enabling dhcp via the webinterface that is using dhcp client to get an IP address from ISP. I think most have dhcp and not a static IP?

comment:3 Changed 19 months ago by anonymous

I fixed this by filtering out addresses that start with 127

/var/www/lmce-admin/operations/network# diff networkSettings.php.org networkSettings.php
55,57c55,64
<     $dns = shell_exec("cat /etc/resolv.conf|awk '/nameserver/ {print $2}'");
<     $dns = implode(", ",explode("\n", trim($dns)));
<     return $dns;
---
>     $dnss = shell_exec("cat /etc/resolv.conf|awk '/nameserver/ {print $2}'");
>     $dnss = explode("\n", trim($dnss));
>     foreach($dnss as $dns)
>     {
>         if(substr($dns,0,3)!="127"){
>             $dnss_[]=$dns;
>         }
>     }
>     $dnss = implode(", ",$dnss_);
>     return $dnss;
61,63c68,77
<     $dns = shell_exec("cat /etc/resolv.conf|awk '/nameserver/ {print $2}'");
<     $dns = implode(", ",explode("\n", trim($dns)));
<     return $dns;
---
>     $dnss = shell_exec("cat /etc/resolv.conf|awk '/nameserver/ {print $2}'");
>     $dnss_ = array();
>     foreach ( $dnss as $dns )
>     {
>         if ( ! substr($dns, 0, 3) === '127' ) {
>             $dnss_[] = explode("\n", trim($dns));
>         }
>     }
>     $dnss = implode(", ", $dnss_);
>     return $dnss;

comment:4 Changed 6 months ago by phenigma

  • Resolution set to invalid
  • Status changed from new to closed

DHCP on the external interface is enabled by default, there is no need to select it unless you have changed the default configuration.

Using localhost as a dns server in resolv.conf is intended. This is by design. On the core 127.0.0.1 is a valid dns nameserver. DHCP data, for clients, is configured in the dhcp server configuration file.

It looks like the ISP is providing bad data in their upstream DHCP configuration. Nothing within the LMCE system affects the dhclient file.

Note: See TracTickets for help on using tickets.