why am i unable to access internet even with being connected to network?

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.


Solution 1:

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