1

ive read through similar posted questions and have not gotten any consistent results. i have a lenovo laptop, with windows 10, i just installed ubuntu 15.10 beside windows. everything seems to work fine with ubuntu except the internet. it says that my connection to the network is strong, i have even connected to several different networks (all wifi) which all demonstrate the same problem. the problem presents in the following manner, when i first turn the computer on, or restart ubuntu, the internet works fine for a few minutes. then, while still connected to the network, i am unable to access any internet sites. i am unable to sudo apt-get install/update/... anything. says repositories are unfound or something.
i am typing this from the same computer, from the same network, while being booted from windows.

ive tried running a few command line tools i was suggested to run to ensure my wireless card was working ok, ive ensured ivp4 is set to automatic (dhcs) or whatever, ive tried setting ivp6 to ignore (which incidentally seemed to work for a while, like 45 minutes, thought that fixed the problem till it started happening again).

so, while being ignorant to alot of these things, it doesnt seem to be a network thing, because this has happened on several different networks. it doesnt seem to be a hardware thing because windows works just fine. ive heard people talking alot about DNS and TCP/IP network protocol stacks, all of which i have a loose understanding of.

so id like to get some direction to getting this issue with ubuntu resolved, and also gain a little understanding of these things that may be causing a problem. thanks again for help.

user74091
  • 175
  • 1
  • 3
  • 12
  • DNS is basically a translator from numeric IP of each website/computer to a domain name, like `google.com`. That's all that is. When you have it set to automatic - it assumes translator provided by your router. You could also set your own. From drop down menu under the network icon you should see "Edit Connections" option. That option should spawn a small window with list of networks. Select your network under wifi, click edit , and under ipv4 settings select `Automatic (DHCP) Address only`. Now, where it says DNS servers, set `8.8.8.8` address. Save and reconnect. Does it help ? – Sergiy Kolodyazhnyy Jan 09 '16 at 02:05
  • In fact, before you even do what I said above, just open terminal and do `ping -c 4 8.8.8.8` and then `ping -c 4 google.com` and let us know which one succeeds , which one doesn't. That should be sufficient to see if it's DNS or not – Sergiy Kolodyazhnyy Jan 09 '16 at 02:07
  • The first ping; ping -c 4 8.8.8.8 resulted in 4 packets transmitted, 4 packets received – user74091 Jan 09 '16 at 04:32
  • Ping -c 4 Google.com resulted in "unknown host Google.com" – user74091 Jan 09 '16 at 04:33
  • Yup, so go ahead and try to set custom DNS, just like I said earlier. – Sergiy Kolodyazhnyy Jan 09 '16 at 04:36
  • So this should read like "DNS servers: 8.8.8.8"? – user74091 Jan 09 '16 at 04:38
  • With automatic (dhcp) address only for IPv4 settings... – user74091 Jan 09 '16 at 04:39
  • Look at this image for reference : http://www.liberiangeek.net/wp-content/uploads/2013/03/google_dns_provider_1_thumb.png – Sergiy Kolodyazhnyy Jan 09 '16 at 04:40
  • After you've changed settings, reconnect – Sergiy Kolodyazhnyy Jan 09 '16 at 04:40
  • Yes, that's how I had it(minus the 8.8.4.4 part, but I tried adding that aswell), and no still not connecting now – user74091 Jan 09 '16 at 04:43
  • Very interesting situation. Here's a link to [network diagnostic script](http://askubuntu.com/q/425155/295286). Follow the instructions and link the results in the comments or by editing your question (preferred ). Then we can continue troubleshooting – Sergiy Kolodyazhnyy Jan 09 '16 at 05:05
  • Tried wired connection, no change. – user74091 Jan 10 '16 at 15:59
  • Those scripts require internet connection so I wasn't able to run it, I should be able to go to the source, download the script and run it from somewhere on my hdd? – user74091 Jan 10 '16 at 16:00
  • You can download it from another computer and transfer over using USB. – Sergiy Kolodyazhnyy Jan 10 '16 at 16:07
  • Also, I'll try to ask one of our experts to join in here, maybe he can suggest a solution – Sergiy Kolodyazhnyy Jan 10 '16 at 16:07
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/34100/discussion-between-user74091-and-serg). – user74091 Jan 10 '16 at 16:10

2 Answers2

2

From the output of the network diagnostic script posted by OP in the chat it became apparent the /etc/resolv.conf as well as /run/resolvconf/resolv.conf are missing. For whatever reason they were not dynamically created.

The solution to the issue was to create the /etc/resolv.conf manually with the following two steps in command line:

sudo tee  /etc/resolv.conf <<< "nameserver 127.0.1.1"
sudo service network-manager restart

Sidenotes

  • 127.0.1.1 address is to allow dnsmasq service to use the dns provided from the router. It could be replaced with custom dns, such as 8.8.8.8 or 208.67.220.220 if one so wishes
  • Since having static /etc/resolv.conf file works, that's a sufficient solution for 90% of the needs, however if one desires one could reconfigure the resolvconf package to dynamically (automatically) create that file. The command for that would be sudo dpkg-reconfigure resolvconf
Sergiy Kolodyazhnyy
  • 103,293
  • 19
  • 273
  • 492
1

I search and searched and searched and everything I found was basics and not fixing anything. I compared with other machines on the network and nothing stood out. And then I came across this, hidden away.
It was exactly the symptoms this PC.

sudo tee /etc/resolv.conf <<< "nameserver 127.0.1.1"

and

sudo gedit /etc/NetworkManager/NetworkManager.conf and change managed=false to managed=true

and after a reboot, all worked great. I did not find the following, nor any of its derivatives worked, but the restart was good enough.
sudo service NetworkManager restart

FloT
  • 2,256
  • 4
  • 13
  • 29
user180042
  • 21
  • 1
  • 6