I'm getting timeout errors on google-related sites. If I try to open google.com, gmail.com, etc, it will keep displaying the "waiting reply" on the browser bottom, and the page won't open. If I am browsing another site that includes, say, www.google-analytics.com, ajax.googleapis.com, google fonts, etc, then it start loading, displaying a "connecting to [google-related site]" on the browser bottom, and stall at that point for a long time.

I can browse other sites fine and they load quickly. I can ping the domains with 0% loss and <100ms times. I can ping 8.8.8.8, I am not behind a proxy, there is nothing on my hosts file, I am not at work or in a networked environment: it is a home network behind a router. I connect using wifi (I am too distant to use wired).

Other users on the same network don't have the issue. I can both ping and browse the sites. I have pinged ajax.googleapis.com from my android and my other laptop, and they return the same IP than on this laptop. They also share the same external IP address, according to http://www.whatismyipaddress.com

The issue happens on ubuntu 12.04, and as it is cyclic but not frequent enough to make sure, I don't honestly remember if it happens on Windows 7 as well (it is a dual-boot machine). Rebooting the router won't help. Rebooting the computer fixes the problem, until it happens again.

It's been happening for a few months now. The last time it happened (earlier today) I performed a ping before and after the reboot. Here's the results:

The issue happens on different browsers, I installed epiphany and it shows the same behaviour.

I have inspected the network tab on firefox and it shows a single, unreplied GET request:

I installed wireshark and listened for HTTP GET requests; on other sites it pops up on the report, but on ajax.googleapis it shows nothing. I listened then for DNS requests, there are some differences:

If connect via telnet to the port 80 of a random site and perform a GET it works, but I can't telnet to ajax.googleapis.com (or it's IP), the connection never completes.

11 Answers
11

Here are a few steps I would take. Never seen this exact behaviour before but I have seen similar!

If you can try it on a different network entirely (work or a friend or tethered to your phone etc).

Try it with a cable (if even for a little while to do a sanity check so to speak). If that isn't a realistic option try using a USB wireless card for a little bit.

Lastly (because there can be problems) you could try resetting the IP stack in Windows (weird that it affects BOTH operating systems but still worth a shot). Be careful as certain software (usually VPN software and some of Ciscos other tools) may require a reinstall. Here is a link to the MS guide on it.

You could take a look on wireshark, a network sniffer, and check what's going on.
Also you could grab a portable linux distribution, burn it on a USB-Stick and check that is it working. you can also compare the ip pinged on a computer with working google, and the other one. And if you have a phone with wifi thethering and data plan, you could check out is it working with that

I have tried wireshark and updated the question. I could try a live distro, but I'd have to keep using it for a weel to make sure the issue is gone, and it wouldn't tell me the cause, I want also to find out the culprit.
–
That Brazilian GuyJan 18 '14 at 11:11

Living in Syria, we face a lot of similar issues, be it local block from our government to some websites, or USA based websites blocking our access due to sanctions.

This looks very similar to cases where there is a local block (or some misconfiguration from the ISP side), ISPs tend to pass port 80 requests via transparent proxies, and that is the source of all kind of problems. In addition, malicious software may implement such thing on your local machine, to do bad things like serving ads or redirecting things...

A solution for this is using https instead of http. with HTTPs, the request can not be intercepted via a transparent proxy, and thus does not inherit any problem that may be caused by such thing. Since your problem is mainly with Google services, you are lucky, since (almost) all of them has https enabled.

Try visiting https://www.google.com/, does it work? if yes, then use the https-everywhere addon for your browser, it will rewrite requests for most known services (Google, Yahoo, Bing, Wordpress...) to https instead of http.

If worked, this is a temporal work around, and needs further investigation into the real source of the problem (Be it a malicious software on your machine or a bad router/ISP configuration...).

Edit: When the issue happens next time, it maybe helpful to look into the output of some commands: pstree, ps aux, sudo iptables -L and netstat -a. It could do a little push towards finding the culprit causing all of this.

You forget that this works just fine for other computers on the same home network.
–
harrymcJan 18 '14 at 18:15

Probably I am overwhelmed with the impression that this has to do with the ISPs! But since other computers on the same network are able to browse with no problem, then we fallback to the other possibility: a malicious software or similar issue on the local machine.
–
aularonJan 18 '14 at 18:20

If you had malware on your computer recently, sometimes they mess with the hosts file to try to stop you from getting to sites that can help you remove the malware.

Use notepad to look at your hosts file (at C:\windows\system32\drivers\etc\hosts) and see if there are any lines that list "google.com". If there are, put a # sign in front of that line and save the file. Reboot and try again.

I have similiar problem, maybe it is not related to you. Everytime I used Firefox on Google sites it just froze and I have to pkill it. It was not only pure google sites but also sites with google ads and so on.

My solution to this was clearing the /var folder. It was full and as soon as I free some space there, problem solved.

Well, since the problem is "local" (restarting the system solves the problem) I would check the system logs for hints (dmesg seems a good place to start). If it doesn't happen with another user or with lynx (or any other command line based browser) then you should consider migrating your stuff to the new user, if it still happens I would blame some bug in the system resolver or someone poisoning your DNS cache (maybe your ISP?). If it's the later, install dig from the bind-utils package, and try to guess from where you get those entries. Depending how your system is configured (dnsmasq, network manager, bind?) you may need different methods to clear the cache.

Note: I'm presuming that the connection go haywire at some point (reusing sockets) and restarting the system flush it. I would do sudo nmap --tracerout -p 80,443 google.com when the connection is OK and when it goes bad to compare and check if the server or something in between has kaput.