resolv.conf contains "nameserver 8.8.8.8" instead of DHCP ns

Topics about the networking software (ssh, nfs, samba, ...). No questions about network drivers there.
rh4009
Posts: 4
Joined: 06 Apr 2011, 20:30

resolv.conf contains "nameserver 8.8.8.8" instead of DHCP ns

Postby rh4009 » 07 Apr 2011, 19:23

Greetings

I use systemrescuecd 2.0.1 by booting it off the network via eth1 on a system with three ethernet interfaces (eth[0-2]).

eth1 is connected to the management network, which includes a DHCP server; the other 2 interfaces are not connected/linked.

After booting is complete, the resulting /etc/resolv.conf file contains "nameserver 8.8.8.8" instead of the info supplied by the DHCP server.

I suspect that the assumed defaults for eth2 overwrite the DHCP assignments for eth1:

>> Performing the network configuration...
Here are the ethernet interfaces found on your system:
* eth0: 00:30:48:D4:73:AB
* eth1: 00:00:00:00:1E:D5
* eth2: 00:30:48:D4:73:AA
--- eth0: link=unknown, mac=00:30:48:D4:73:AB
>> Attempting to get a DHCP address on eth0...
udhcpc (v1.18.2) started
Sending discover...
Sending discover...
Sending discover...
No lease, failing
busybox udhcpc -n -i eth0 --> 1
--- eth1: link=link-ok, mac=00:00:00:00:1E:D5
>> Attempting to get a DHCP address on eth1...
udhcpc (v1.18.2) started
Sending discover...
Sending select for 192.168.220.130...
Lease of 192.168.220.130 obtained, lease time 1000000
set new default route: 192.168.220.1
busybox udhcpc -n -i eth1 --> 0
--- eth2: link=unknown, mac=00:30:48:D4:73:AA
>> Attempting to get a DHCP address on eth2...
udhcpc (v1.18.2) started
Sending discover...
Sending discover...
Sending discover...
No lease, failing
busybox udhcpc -n -i eth2 --> 1

Is there a simple way to get resolv.conf to not be overwriten ? In case all 3 interfaces are active, would it be merged from the 3 DHCP servers?

The 8.8.8.8 server (google public DNS I believe) cannot resolve local network hostnames, which are not exported publicly.

Thanks
Radu

EDIT: to clarify that I use systemrescuecd 2.0.1

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: resolv.conf contains "nameserver 8.8.8.8" instead of DHC

Postby gernot » 09 Apr 2011, 08:22

Your log show that only eth1 has a dhcp server.
Have you a DHCP server in the net who send the 8.8.8.8 ?

After the initrd run the network is configurated again from /etc/init.d.
There are Networkmanager and network who can do the reconfig.
If Networkmanager overwrites /etc/resolv.conf it add a note to it.

Gernot

n8bounds
Posts: 59
Joined: 24 Oct 2008, 13:39
Contact:

Re: resolv.conf contains "nameserver 8.8.8.8" instead of DHC

Postby n8bounds » 10 May 2011, 12:35

Same problem. During PXE boot it gets a lease 3 times in total, I believe. The last one ignores the nameservers sent from the dhcp3-server and uses Google's DNS instead. I can understand how this behavior would be useful if you were booting from USB or CD and weren't trying to use autorun scripts.

In one of my autorun scripts, I had the PXE clients mounting a network export/share via hostname. I changed it to IP address for now. Running dhclient before starting X seems to get /etc/resolv.conf right.

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: resolv.conf contains "nameserver 8.8.8.8" instead of DHC

Postby gernot » 10 May 2011, 15:19

The nameserver 8.8.8.8 is hard coded in the squashfs file
/livemnt/squashfs/etc/resolv.conf
This shold be overwritten by dhcpd.
Can you trace (with tcpdump or wireshark) the UDP packages your nameserver send?
Have you a file /livemnt/memory/etc/resolv.conf ? Livemnt/squashfs and /livemnt/memory are mountd together as /.

Gernot

cschanzle
Posts: 11
Joined: 28 Sep 2009, 21:34

Re: resolv.conf contains "nameserver 8.8.8.8" instead of DHC

Postby cschanzle » 25 Nov 2011, 20:12

I debugged this issue with 2.4.0 (been using 1.6.3 too long). I use PXE booting.
When booting, there's about 25 lines of:

netconfig2: Cannot get a DHCP address. Check the cables on the ethernet interfaces.

There's an error in /etc/init.d/netconfig2

Code: Select all

for curdev in ${NETDEVICES}

should be

Code: Select all

for curdev in ${DHCPDEVICES}


After changing manually and re-running /etc/init.d/netconfig2 restart , /etc/resolv.conf is correctly populated with what my DHCP server sends.

cschanzle
Posts: 11
Joined: 28 Sep 2009, 21:34

Re: resolv.conf contains "nameserver 8.8.8.8" instead of DHC

Postby cschanzle » 05 Jan 2012, 23:14

Noticed this fix was not in 2.4.1... I think it's pretty obvious if you study /etc/init.d/netconfig2 that NETDEVICES is not the right variable to use.

admin
Site Admin
Posts: 2715
Joined: 17 Jul 2003, 09:44

Re: resolv.conf contains "nameserver 8.8.8.8" instead of DHC

Postby admin » 07 Mar 2012, 20:53

This has been fixed in 2.5.1-beta002, sorry for the delay

diegorubert
Posts: 2
Joined: 17 Oct 2012, 16:58

Re: resolv.conf contains "nameserver 8.8.8.8" instead of DHC

Postby diegorubert » 17 Oct 2012, 17:08

It seems the problem is present at 3.0.0.
There is no NETDEVICES in /etc/init.d/netconfig2, but resolv.conf has only 8.8.8.8.
I'm running on pxe. Probably it gets the correct nameserver but it's overridden later, because it mounts nfs share correctly at beginning using a local domain name.
Can anyone confirm?
Thanks

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: resolv.conf contains "nameserver 8.8.8.8" instead of DHC

Postby gernot » 18 Oct 2012, 08:11

netconfig2 start dhcp only if you use the "dodhcp" bootoption.
While nonpxe booting Networkmanager makes this job.

check the file /var/log/netconfig2.log.

The 8.8.8.8 (google public DNS) is used in the squashed rootfilesystem (sysrcd.dat).

Gernot

diegorubert
Posts: 2
Joined: 17 Oct 2012, 16:58

Re: resolv.conf contains "nameserver 8.8.8.8" instead of DHC

Postby diegorubert » 18 Oct 2012, 21:47

Hi gernot,
that totally solved my problem.
Sorry for not reading all options first.
Many thanks!

smoke
Posts: 2
Joined: 28 Jan 2017, 23:38

Re: resolv.conf contains "nameserver 8.8.8.8" instead of DHC

Postby smoke » 28 Jan 2017, 23:40

It's already fixed


Return to “Networking (except PXE booting)”

Who is online

Users browsing this forum: No registered users and 3 guests