I had Ubuntu 12.04 previously installed on my Laptop and i was having problems in connecting to internet (I was connecting to Wifi), and Chrome and Firefox both showed "Connection to Server lost", and when i tried updating through terminal it was also not able to connect to internet, but my bittorrent client was connecting fine to Wifi internet connection. So i installed Ubuntu 14.04 alongside Windows 7 and i'm having same problem in it also.
Also if i try disconnecting to Wifi and connect again, internet works fine for 5-10 minutes but then again it starts giving error. Also, there is no problem in internet connection as it is working fine with my Android Device and Windows 7.
The full output can be found here.
The script output can be found here.