[SLUG] resolv.conf reset each reboot - static config - ubuntu server 10.04
Hi, I feel imbecilic, because this is not making sense to me. Static ip, resolvconf installed, I even went so far as to purge uninstall dhcp3-client, and yet: on each reboot, resolv.conf comes up empty (no nameservers). SSH is working. Evironment: Ubuntu 10.04 server, running in a vmware instance provided to me minimal install reslvconf installed dhcp3-client purged Ok on reboot (and ssh in), this is what I get: ~# ifconfig eth0 Link encap:Ethernet HWaddr 00:50:56:9b:00:02 inet addr:203.98.76.25 Bcast:203.98.76.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:fe9b:2/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:874 errors:0 dropped:0 overruns:0 frame:0 TX packets:145 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:76682 (76.6 KB) TX bytes:18678 (18.6 KB) Interrupt:18 Base address:0x2024 loLink encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:34 errors:0 dropped:0 overruns:0 frame:0 TX packets:34 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:2464 (2.4 KB) TX bytes:2464 (2.4 KB) ~# cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN ~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric RefUse Iface 203.98.76.0 0.0.0.0 255.255.255.0 U 0 00 eth0 0.0.0.0 203.98.76.1 0.0.0.0 UG10000 eth0 ~# cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 #iface eth0 inet dhcp iface eth0 inet static address 203.98.76.25 netmask 255.255.255.0 network 203.98.76.0 gateway 203.98.76.1 dns-nameservers 61.88.88.88 202.12.144.10 203.0.178.191 202.12.144.11 ~# aptitude show resolvconf dhcp3-client|grep State State: installed State: not installed And the frustrating thing is it all is fine if I /etc/init.d/networking restart, or as follows: ~# ifdown eth0; ifup eth0; cat /etc/resolv.conf ssh stop/waiting ssh start/running, process 1459 # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 61.88.88.88 nameserver 202.12.144.10 nameserver 203.0.178.191 Any ideas what the firetruck I'm missing? Is it some new init magic that I'm not familiar with? TIA Zen -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] resolv.conf reset each reboot - static config - ubuntu server 10.04
> There is a network configuration file in RHEL or Fedora. > /etc/sysconfig/network-scripts/ifcfg-eth0(for e.g.) This is an ubuntu 10.04 server (as mentioned) and I can't find the file you are referring to. > I believe you can specify a nameserver in interfaces in 10.04 > check out man resolvconf Pretty sure I've done that already. I assume you're referring to /etc/network/interfaces This is why /etc/init.d/networking restart after bootup works, because it actually is (or at least appears to be) configured correctly (see below). Also, ifdown eth0; ifup eth0 does the same "fixup" job for my pursposes (only have one eth device). So somehow it is just the bootup scenario where this server fails to properly configure itself with the DNS servers as configured by me. The configuration is really simple as far as I can tell, which is why I'm thinking may be there's some new init-fu which I am currently unaware of... Any Ubuntu init-fu gurus around? >From my first email: - ~# cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 #iface eth0 inet dhcp iface eth0 inet static address 203.98.76.25 netmask 255.255.255.0 network 203.98.76.0 gateway 203.98.76.1 dns-nameservers 61.88.88.88 202.12.144.10 203.0.178.191 202.12.144.11 On 2011-07-01, Jake Anderson wrote: > I believe you can specify a nameserver in interfaces in 10.04 > check out man resolvconf > > On 07/01/2011 02:00 AM, Zenaan Harkness wrote: >> Hi, I feel imbecilic, because this is not making sense to me. >> >> Static ip, resolvconf installed, I even went so far as to purge >> uninstall dhcp3-client, and yet: >> on each reboot, resolv.conf comes up empty (no nameservers). >> >> SSH is working. >> >> Evironment: >> Ubuntu 10.04 server, running in a vmware instance provided to me >> minimal install >> reslvconf installed >> dhcp3-client purged >> >> Ok on reboot (and ssh in), this is what I get: >> ~# ifconfig >> eth0 Link encap:Ethernet HWaddr 00:50:56:9b:00:02 >>inet addr:203.98.76.25 Bcast:203.98.76.255 Mask:255.255.255.0 >>inet6 addr: fe80::250:56ff:fe9b:2/64 Scope:Link >>UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >>RX packets:874 errors:0 dropped:0 overruns:0 frame:0 >>TX packets:145 errors:0 dropped:0 overruns:0 carrier:0 >>collisions:0 txqueuelen:1000 >>RX bytes:76682 (76.6 KB) TX bytes:18678 (18.6 KB) >>Interrupt:18 Base address:0x2024 >> >> loLink encap:Local Loopback >>inet addr:127.0.0.1 Mask:255.0.0.0 >>inet6 addr: ::1/128 Scope:Host >>UP LOOPBACK RUNNING MTU:16436 Metric:1 >>RX packets:34 errors:0 dropped:0 overruns:0 frame:0 >>TX packets:34 errors:0 dropped:0 overruns:0 carrier:0 >>collisions:0 txqueuelen:0 >>RX bytes:2464 (2.4 KB) TX bytes:2464 (2.4 KB) >> >> ~# cat /etc/resolv.conf >> # Dynamic resolv.conf(5) file for glibc resolver(3) generated by >> resolvconf(8) >> # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN >> ~# route -n >> Kernel IP routing table >> Destination Gateway Genmask Flags Metric RefUse >> Iface >> 203.98.76.0 0.0.0.0 255.255.255.0 U 0 00 >> eth0 >> 0.0.0.0 203.98.76.1 0.0.0.0 UG10000 >> eth0 >> ~# cat /etc/network/interfaces >> # This file describes the network interfaces available on your system >> # and how to activate them. For more information, see interfaces(5). >> >> # The loopback network interface >> auto lo >> iface lo inet loopback >> >> # The primary network interface >> auto eth0 >> #iface eth0 inet dhcp >> iface eth0 inet static >> address 203.98.76.25 >> netmask 255.255.255.0 >> network 203.98.76.0 >> gateway 203.98.76.1 >> dns-nameservers 61.88.88.88 202.12.144.10 203.0.178.191 >> 202.12.144.11 >> ~# aptitude show resolvconf dhcp3-client|grep State >> State: installed >> State: not installed >> >> >> And the frustrating thing is it all is fine if I >> /etc/init.d/networking restart, or as follows: >> ~# ifdown eth0; ifup eth0; cat /etc/resolv.conf >> ssh stop/waiting >> ssh start/running, process 1459 >> # Dynamic resolv.conf(5) file for glibc resolver(3) generated by >> resolvconf(8) >> # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN >> nameserver 61.88.88.88 >> nameserver 202.12.144.10 >> nameserver 203.0.178.191 >> >> >> Any ideas what the firetruck I'm missing? Is it some new init magic >> that I'm not familiar with? >> >> TIA >> Zen > > -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http
Re: [SLUG] resolv.conf reset each reboot - static config - ubuntu server 10.04
Zenaan Harkness wrote: > > There is a network configuration file in RHEL or Fedora. > > /etc/sysconfig/network-scripts/ifcfg-eth0(for e.g.) > > This is an ubuntu 10.04 server (as mentioned) and I can't find the > file you are referring to. The file /etc/sysconfig/network-scripts/ifcfg-eth0 is redhat specific (possibly also suse). > > I believe you can specify a nameserver in interfaces in 10.04 > > check out man resolvconf > > Pretty sure I've done that already. I assume you're referring to > /etc/network/interfaces If you have defined your interface as static, why have you got resolvconf installed? Remove it (ie purge it), then make sure /etc/resolv.conf is not a symlink and then edit that file to your liking. Or better yet, defined them in /etc/network/interfaces. Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] resolv.conf reset each reboot - static config - ubuntu server 10.04
On Fri, 2011-07-01 at 02:00 +1000, Zenaan Harkness wrote: > Static ip, resolvconf installed, I even went so far ... Why not just uninstall resolvconf and configure /etc/resolv.conf manually? It's not like you have to configure it more than once. AfC Sydney signature.asc Description: This is a digitally signed message part -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] resolv.conf reset each reboot - static config - ubuntu server 10.04
Of course. Remove resolvconf. That's the obvious - I knew I was missing something obvious. On my laptop, resolvconf facilitates bringing eth devices up and down in different networks, but that's not needed for a server. Somehow had it in my mind that resolvconf was needed to update resolv.conf. I shall remove resolvconf. Still seems like there is a bug in there though - if it was my laptop, and by default I want eth0 to come up static, and I use resolvconf, and the DNS servers do not end up in resolv.conf on first bootup, I'd call it an error. Thanks for the feedback Zen -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] resolv.conf reset each reboot - static config - ubuntu server 10.04
Hi, On Thursday, June 30, 2011 06:00:33 PM Zenaan Harkness wrote: > Hi, I feel imbecilic, because this is not making sense to me. > > Static ip, resolvconf installed, I even went so far as to purge > uninstall dhcp3-client, and yet: > on each reboot, resolv.conf comes up empty (no nameservers). > > Any ideas what the firetruck I'm missing? Is it some new init magic > that I'm not familiar with? > > TIA > Zen You are missing the obvious thing: > # Dynamic resolv.conf(5) file for glibc resolver(3) generated by > resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE > OVERWRITTEN nameserver 61.88.88.88 You can either edit the file /etc/network/interfaces auto eth0 iface eth0 inet dhcp dns-nameservers ip.addresse.des.nameservers << add this Or the file /etc/dhcp3/dhclient.conf prepend domain-name-servers 85.214.73.63; << add this request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name, << Delete domain-name-servers -- Erwin Mueller http://www.global-scaling-institute.de/ -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Re: [SLUG] resolv.conf reset each reboot - static config - ubuntu server 10.04
On 2011-07-02, Erwin Mueller wrote: > On Thursday, June 30, 2011 06:00:33 PM Zenaan Harkness wrote: >> Static ip, resolvconf installed, I even went so far as to purge >> uninstall dhcp3-client, and yet: >> on each reboot, resolv.conf comes up empty (no nameservers). > You are missing the obvious thing: > >> # Dynamic resolv.conf(5) file for glibc resolver(3) generated by >> resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE >> OVERWRITTEN nameserver 61.88.88.88 > > You can either edit the file /etc/network/interfaces > > auto eth0 > iface eth0 inet dhcp > dns-nameservers ip.addresse.des.nameservers << add this This is what I had - if you look at my earlier email(s) you will see I had dns-nameservers line in /etc/network/interfaces, which is why this 'problem' is so baffling to me. > Or the file /etc/dhcp3/dhclient.conf Not relevant because I'm not using dhcp. I even removed dhcp3-client and that did not fix the problem. But as per Eric's suggestion, removing the package resolvconf also did the job, since server has no requirement for network settings to be changed once set. BUT, if it were my laptop, not a server, and I wanted resolvconf so I could include dns-nameservers lines in /etc/network/interfaces, then I should still get a proper network config on first boot, _without_ having to run /etc/init.d/networking restart just after first boot. I would have guessed that perhaps there's some interplay between dhcp-client and resolvconf, but the fact is this "no dns servers on initial boot" 'bug' appeared with and without dhcp3-client installed. Zen -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html