Ping works fine, but no Internet connection in browser

Without having changed any settings, I can't access the Internet anymore through my laptop running Windows 10. Every browser tells me the connection has timed out. I can connect to the router and other devices on the network are not affected. Windows tells me that I am "connected to the Internet" but apparently, that's no help. It doesn't seem to work through other WiFi networks or ethernet either.

ping google.com works fine and surfing by IP address does not help. I tried restarting the computer, restarting the router, resetting IP configuration with no avail. I couldn't find a problem in the network settings either. I tried about anything suggested on this website. I hope someone of you has any idea as to what could resolve the issue. Thanks.

Update

So it turns out I can access google websites such as google.com or youtube, but nothing else. I tried some of the suggestions I found online, but nothing worked. Ideas?


Solution 1:

I can't access the Internet anymore

Try reinitialising the network states. Run the following commands in an elevated cmd shell:

  • Reset WINSOCK entries to installation defaults:

    netsh winsock reset catalog

  • Reset TCP/IP stack to installation defaults:

    netsh int ip reset reset.log

  • Reset Firewall to installation defaults:

    netsh advfirewall reset

  • Flush DNS resolver cache:

    ipconfig /flushdns

  • Renew DNS client registration and refresh DHCP leases:

    ipconfig /registerdns

  • Flush routing table (reboot required):

    route /f

Solution 2:

Are you coming here because you have a MacBook Pro running Windows 10 and this exact issue?

The solution is to go to Device Manager, find your Wi-Fi card and run Roll Back Driver. If Rollback Driver is disabled, follow update driver, browse your computer, and select let me pick. Choose an earlier version from that list.

Roll Back Driver

Solution 3:

Your update indicates you can only access two websites, google.com and youtube.com. For other sites that are inaccessible via your browser, can you successfully ping them?

You could try accessing problematic websites outside of a browser with a Telnet client, such as PuTTY. You can use PuTTY to issue the commands a browser issues to retrieve content from a website. Or you can install a telnet client from Microsoft, if you are using a Microsoft Windows system by opening a command prompt window with administrator access and issuing the command pkgmgr /iu:"TelnetClient". Once that telnet client is installed, you can then issue the command telnet www.example.com 80 from a command prompt.

If you are able to successfully connect on port 80, the well-known port for HTTP connections, you will then just see the black background for the command prompt window with a flashing cursor. Type the command GET / HTTP/1.1 and hit Enter. Then type the command Host: www.example.com and hit Enter twice. Note: the website won't echo the characters you type back to you, so you won't be able to see what you are typing, so you can't readily see if you've made a typo. But even if you make a typo, if you have been able to successfully connect to the website, it will display a message such as "404 - Not Found", which at least tells you that you can successfully connect to the website outside of a browser. I've found in some cases where malware has affected connectivity to websites from browsers on the system, that I could successfully connect to sites using a telnet client, which helped me isolate the problem.

You can return to the telnet prompt by using the Ctrl-] keys, i.e,, hit Ctrl and ] simultaneously. You can exit from the telnet program by typing the command quit at the Microsoft Telnet> prompt..

The commands provided to the website in the example above perform the following functions:

GET / HTTP/1.1 - get informs the site that you wish to retrieve a web page on the site while the forward slash tells the site that you want to retrieve the main page for the site and HTTP/1.1 tells it you want to use version 1.1 of the HTTP protocol. That's the version that allows you to specify the domain name, since many webservers host multiple websites.

Host: www.example.com - tells a server that may support multiple websites that you want a page on the site www.example.com. Note that www.example.com is an actual website created specifically for people to use in documentation examples. If you connect to the site, you will see "This domain is established to be used for illustrative examples in documents. You may use this domain in examples without prior coordination or asking for permission." So, if you use it and are able to see the text on the webpage for that site displayed, then you know that there is some issue affecting browsers on the system, but at the TCP/IP level and at the HTTP protocol level, you do have access to the sites that are inaccessible by a browser or browsers on the system.

Alternatively, I've found HTTPNetworkSniffer is sometimes helpful in debugging problems with website access. It is free and can be downloaded from the website of the developer, Nir Sofer, at HTTPNetworkSniffer. You could run that program while attempting to access a site within a browser on the system and at least see if the browser is actually attempting to communicate with the problematic sites, i.e., that attempts to access a problematic site are getting from the browser to the TCP layer of the network protocol stack.

You could also use the free and open source packet analyzer, Wireshark, but being able to understand the information it provides requires familiarity with how the underlying protocols of the Internet, such as TCP/IP work. There are courses and tutorials on its usage online, including YouTube videos. But learning how to use it effectively may take a fair amount of time. The advantage is, though, that once you learn how to use a tool such as Wireshark, you will be able to more easily troubleshoot all sorts of problems involving network connectivity.

On YouTube, there is WireShark Tutorial for Beginners and Wireshark 101: How to Wireshark, Haktip 115; many others can be found by searching on the terms "Wireshark tutorial". Websites with tutorials include Quick and dirty Wireshark tutorial, How to Use Wireshark to Capture, Filter and Inspect Packets, and Wireshark Tutorial, which is a PDF file created by Professor Angelos Stavrou in the Computer Science Department of George Mason University.

Udemy offers online courses at a relatively low cost. E.g., Wireshark in 60 minutes and The Complete Wireshark Course: Go from Beginner to Advanced! are $10 USD at the moment. Search the site for "Wireshark" to find other courses on Wireshark. Lynda.com also offers courses - see Wireshark Training and Tutorials. You can find online courses from others by a web search on "Wireshark course". I can't vouch for any of those Wireshark courses personally, since my learning to use it has been based on installing it and using it to troubleshoot particular network problems over time.

Solution 4:

This same issue kept happening to me on Windows 10: I would suddenly lose all ability to open new websites or connect to new ports (even localhost:8080) in any browser, but I could still ping remote servers, and already-open WebSockets (e.g., in a chat program) continued to work. Switching from WiFi to Ethernet (and vice-versa) had no effect.

My problem stemmed from two events:

  1. Every time this issue started, I would also get this event in the Event Viewer program, under "Administrative Events": Event 4231, Tcpip: A request to allocate an ephemeral port number from the global TCP port space has failed due to all such ports being in use.

  2. When I opened a CMD or PowerShell and entered the command Get-NetTCPConnection, it showed that nearly all of my ~60,000 ports were being used by a process with a certain PID. I opened the Task Manager, found the service with that PID, and clicked "End process tree". That freed up most of my ~60,000 ports and fixed the issue.

Update: my problem turned out to be caused by this issue.

Solution 5:

I've seen this happen due to Path MTU Discovery black holes. If you are sending packets that are too large for your network and some part of your network is keeping you from discovering that fact, then you'll only be able to connect to some websites that insist on smaller packets when negotiating each TCP connection, such as Google.

Try setting your MTU down to something smallish like 1300 and see if you can connect to other websites. If that fixes it, then try increasing your MTU until you find the highest value that works.