EDIT 2: Previous post was rightfully deleted by the moderation, I'm posting what I have found to be a solution. Sorry for that.
EDIT: I just found the answer and it's in this very page - sorry for my miopy. I posted my findings below, expanding the correct answer by Richard Lindstedt found in this page. I left my early rumbling for a bit of context. Please upvote Richard's answer, he deserves it.
It's actually really easy.
just open your interfaces conf file --> sudo vi /etc/network/interfaces
That sure did not help the OP and doesn't help me now. We don't want static addresses, we want to use the ones the DHCP server sends us. NetworkManager seems to recognise them, but Ubuntu bluntly ignores them:
# nmcli dev list iface wlan0 | grep IP4.DNS
IP4.DNS[1]: 10.*.*.*
IP4.DNS[2]: 10.*.*.*
IP4.DNS[3]: 8.8.8.8
But...
# dig microsoft.com
; <<>> DiG 9.9.5-4.3-Ubuntu <<>> microsoft.com
;; global options: cmd
;; connection timed out; no servers could be reached
And my /etc/network/interfaces is:
auto lo
iface lo inet loopback
which is a bit odd, I would expect all interfaces being declared here (or am I missing something?).
So, in short:
- I did not mess with any file to start with
- I have already run
dpkg-reconfigure resolvconf
- The right symlink is in place
- NetworkManager retrieves the correct DNS servers from DHCP
- Ubuntu DOES NOT use such addresses
- The workaround is to put fixed 8.8.8.8 on /etc/network/interfaces WHICH I DON'T WANT
- I want to use the DHCP-provided DNS servers in any and all situations.
Not opening another thread because it's the exact problem except I'm on 14.10 now (but this have been nagging me since de upgrade from 12.10 to 13.04).
SOLUTION
That last phrase got me on the right track, and only then I noticed Richard's answer.
The problem seems to be related to the conflicting dnsmasq
and resolvconf
packages. Until 12.10, dnsmasq
was used. From 13.04 onwards, Ubuntu seemed to switch to a dnsmasq/resolvconf hybrid, where you have installed the packages dnsmasq-base
and resolvconf
, but not dnsmasq
itself.
I can't say if it's a bug in the upgrade scripts for 13.04 or something else, because when upgrading (as in fresh installs) resolvconf is installed, dnsmasq-base is upgraded and dnsmasq is (correctly) uninstalled.
The catch is, the upgrade script fails to comment out the dns=dnsmasq
line in /etc/NetworkManager/NetworkManager.conf
. So, even though the dnsmasq daemon is not present anymore on the system, /etc/resolv.conf still expects it to be.