Basically every Ubuntu upgrade I run into this issue of my network connection dropping all the time – at least it looks that way. What temporarily solves it is clicking the “Auto Ethernet” item in the Network menu, but when it happens once every few minutes, it gets pretty frustrating. Especially since plenty of JavaScript based sites don’t handle sudden errors like that properly so I often ended up clicking on the retweet button a bunch of times before I realized something was wrong and confirmed it was my connection (again) in the browser’s console.

It kept throwing errors like DNS_PROBE_FINISHED_BAD_CONFIG and various other DNS related errors (NXDOMAIN, NO_INTERNET). Searching the net gives plenty of options for possible points of failure, and fixing the NetworkManager.conf (that was overwritten during the upgrade) helped me before.

[main]
plugins=ifupdown,keyfile,ofono

[ifupdown]
managed=true

That’s my config file, and once the contents are right, sudo service network-manager reload should solve the issue.

sudo /etc/init.d/dns-clean restart and sudo /etc/init.d/networking force-reload might play a role too – definitely worth a try if nothing else seems to help (and I’m positive they can’t have any negative side-effects).

Debugging where exactly the error occurs and what exactly solves it is not easy because it doesn’t pop up reliably when something is wrong. Sometimes hours go by without an error, sometimes it drops again in 10 seconds. This makes it difficult to say what actually did the trick.

Interestingly, I discovered what (might) cause this for me: as the errors kept popping up even after I tried all the methods I could find in forums and blogs, I just tried pinging google.com. There I saw something really strange: google.com was resolved to an IPv6 address. I knew for sure that my cable modem does not support IPv6 (yet) because I spent a few hours the other day trying to set it up.

Once I set it to “Ignore” in the network manager and reloaded the services mentioned above, there are no errors now. For now. I mean, that’s pretty obvious: if the DNS returns an IPv6 address that my computer recognizes, but not my cable modem, there’s bound to be trouble. What’s confusing though is that the last time I had this problem I definitely didn’t disable IPv6 (at least not knowingly).