View Full Version : [SOLVED] Lost DNS in upgrade to Precise
arist
Apr 29th 2012, 06:21 AM
Today I did the network upgrade from 11.10 to 12.04 on my desktop computer. Everything seemed to go well, but after restarting I was unable to access the Internet. Pinging a domain name returns "unknown host". I can ping IP addresses, however. I went into System Settings>Network Connections and made sure that the address for the DNS server is the same as on my netbook (which is still running Oneiric). I tried replacing /etc/NetworkManager/NetworkManager.conf with the old (Oneiric) version, then went back. After every change I did a restart. No luck. I'm sure there's a simple solution for this. What is it?
SteveRiley
Apr 29th 2012, 06:51 AM
One of the changes that Precise brings is the introduction of dnsmasq, configured as a local DNS cache. I've experimented with various ways of removing this, but the result always feels brittle. Ultimately, I ended up commenting out one line -- shown in bold -- in /etc/NetworkManager/NetworkManager.conf:
steve@x1:~$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
# dns=dnsmasq
no-auto-default=F0:DE:F1:A5:AA:41,
[ifupdown]
managed=false
Now, when I examine /etc/resolv.conf, I can see the DNS servers that I've configured my DHCP server (actually, my router) to supply:
steve@x1:~$ cat /etc/resolv.conf
nameserver 4.2.2.1
nameserver 4.2.2.2
search local
arist
Apr 29th 2012, 08:53 AM
Ultimately, I ended up commenting out one line -- shown in bold -- in /etc/NetworkManager/NetworkManager.conf:
steve@x1:~$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
# dns=dnsmasq
Yes, that's the very first thing I did, commenting out that line. Made no difference.
Now, when I examine /etc/resolv.conf, I can see the DNS servers that I've configured my DHCP server (actually, my router) to supply:
steve@x1:~$ cat /etc/resolv.conf
nameserver 4.2.2.1
nameserver 4.2.2.2
search local
Funny, my resolv.conf file has no nameservers in it. It looks like this:
#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.
Invoking resolvconf -u does nothing. I tried editing the file by hand, basically copying the one from the netbook, and after rebooting it is indeed overwritten, going back to the above. There must be a way to get my nameserver into resolv.conf.
SteveRiley
Apr 29th 2012, 09:23 AM
I'll take another look tomorrow. Seem to recall another step, but will need to check bash history first.
arist
Apr 29th 2012, 05:51 PM
Following these instructions, http://manpages.ubuntu.com/manpages/precise/man8/resolvconf.8.html, I added a "dns-nameservers" line to /etc/network/interfaces, and now the nameservers show up in resolv.conf, and I have Internet again.
GreyGeek
Apr 29th 2012, 06:52 PM
My /etc/resolv.conf has the following:
# 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 127.0.0.1
search earthlink.net
And my internet connection works fine against both the wireless and the eth0 connections.
Also, I added my ISP domain and DNS addresses in my TL-WR1043N wireless router.
Snowhog
Apr 29th 2012, 07:02 PM
My /etc/resolv.conf contains:
# Generated by NetworkManager
nameserver 127.0.0.1
Wired and wireless work without any issues what so ever.
My /etc/NetworkManager/NetworkManager.conf contains:
[main]
plugins=ifupdown,keyfile
dns=dnsmasq
no-auto-default=98:4B:E1:C4:95:02,
[ifupdown]
managed=false
SteveRiley
Apr 29th 2012, 09:55 PM
Following these instructions, http://manpages.ubuntu.com/manpages/precise/man8/resolvconf.8.html, I added a "dns-nameservers" line to /etc/network/interfaces, and now the nameservers show up in resolv.conf, and I have Internet again.
Are you using static IP addresses defined in /etc/network/interfaces?
My /etc/resolv.conf contains:
---
My /etc/NetworkManager/NetworkManager.conf contains:
Those are the expected configuration files when DHCP assigns IP addresses and you haven't made any changes to dnsmasq.
Snowhog
Apr 29th 2012, 11:37 PM
Those are the expected configuration files when DHCP assigns IP addresses and you haven't made any changes to dnsmasq.
Which is my case. I too, was thinking that arist might be using a static IP.
arist
Apr 30th 2012, 12:00 AM
Are you using static IP addresses defined in /etc/network/interfaces?
Those are the expected configuration files when DHCP assigns IP addresses and you haven't made any changes to dnsmasq.
That's right, I'm using static IPs for my computers, so I can network them using NFS. That undoubtedly complicates things, but it hadn't occurred to me that whether I was using DHCP or not would affect DNS. Before Precise it had never been necessary to do anything with /etc/network/interfaces in order to get DNS to work with static IPs. I haven't made changes to dnsmasq: NetworkManager.conf is the default version.
Curious that Snowhog's resolv.conf is generated by NetworkManager, while GreyGeek's and mine are generated by resolvconf. Would that be because we use static IPs?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.