How to resolve “ERR_CONNECTION_CLOSED”
What does “ERR_CONNECTION_CLOSED” mean?
Nothing is more annoying than getting an error message when opening a website. But don’t worry this blog will help figure out what’s going wrong and how to fix it.
It is a very common error and it is generally caused by the connectivity issues between your browser and website. To understand more about it we have first to know how browsers work when you try to visit a site. When you click on a link or enter the domain name in the search bar of your browser, the browser makes a connection request to the server, and once the connection is established, the browser will request files from the server that are necessary to render the website.
This error message is an indication that something went wrong while establishing the connection or maintaining the connection. So to fix the “ERR_CONNECTION_CLOSED” we will look into the things that affect this connectivity issue and try to fix them.
1. Check the Internet Connection
Before diving into the complex solutions, ensure your internet connection is stable and active. One way to check that the internet connection is the problem is by using your mobile device and trying to access the internet, (play a song or video), and if it’s working you know that something else is causing the error.
2. Clear your Browsing Data/Cache
An outdated/expired or corrupted cache can cause connectivity issues, which results in an “ERR_CONNECTION_CLOSED” error. Clearing your browsing data/cache can be a quick fix in such cases.
3. Flush DNS Cache
Your computer maintains a DNS cache, functioning as a local repository containing previously visited website DNS lookup records. This cache enables quicker access to these sites upon subsequent visits. Nevertheless, outdated, corrupted, or inaccurate DNS settings can hinder connections to certain websites, leading to the ERR_CONNECTION_CLOSED error.
To address this issue, you can refresh the DNS cache on your computer, prompting it to store updated DNS information. Refer to one of the tutorials below to find the specific steps for your operating system (OS).
Ways to flush DNS Cache
Flushing DNS in Windows:
- Open the command prompt and open it as administrative.
- Type in the command ipconfig /flushdns
- After the execution of the command, you will get a message of success.
Flushing DNS in Linux: Based on your distribution, enter the following command
- Ubuntu:
sudo resolvectl flush-caches
- NCSD:
sudo /etc/init.d/nscd restart
- Dnsmasq:
sudo /etc/init.d/dnsmasq restart
- BIND:
sudo /etc/init.d/named restart
Flushing DNS in Mac: Open the terminal using the spotlight or by Finder>Utilities>Terminal
Enter the following command:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
For the older versions of the Mac OS
- macOS Monterey, macOS Big Sur, macOS Catalina:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- macOS Mojave, macOS High Sierra, macOS Sierra, OS X Mountain Lion, Mac OS X Lion:
sudo killall -HUP mDNSResponder
- Mac OS X El Capitan, OS X Mavericks:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- OS X Yosemite:
sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches
- Mac OS X Snow Leopard,Mac OS X Leopard:
sudo dscacheutil -flushcache
- Mac OS X Tiger:
lookupd -flushcache
Flushing DNS in Browser:
chrome://net-internals/#dns
4. Change the DNS Servers
When you enter a website URL into your browser, your computer communicates with DNS servers to retrieve the corresponding server IP address. If the DNS server is inaccessible or you attempt to connect to an incorrect DNS server address, your computer fails to obtain website addresses, potentially resulting in the ERR_CONNECTION_CLOSED error.
To rectify this issue, you can modify your default DNS server addresses. For instance, if your default DNS servers are unavailable, you can opt to utilize Google DNS servers instead.
- Google DNS Server:
8.8.8.8
8.8.4.4
Follow the steps below to change the DNS server on Windows 10 or 11
- Open the Window menu and type “Control Panel” and open it.
- Navigate to Network & Internet > Network and Sharing Center
- Click on View network status and task and view your active networks.
- On the following pop-up windows, select Properties and then select the item Internet Protocol Version 4 (TCP/IPv4)
- Then manually enter the DNS server address, choose Use the following DNS server address.
For Mac OS:
To change these settings, choose Apple menu > System Settings, click Network in the sidebar, click a network service on the right, click Details, then click DNS.
Then you will find the list of DNS servers and to add DNS servers, click on the + button to add DNS server.
5. Check the Status of the Hosting IP Address
This method is especially for website owners to check whether their website’s IP address is subject to a null route. A null route is a network route(routing table entry) that leads to nowhere.
To check if the website is null routed, ping its IP address or domain.
ping google.com
or
ping 216.58.200.206
If the server doesn’t return a ping reply, then the website might be null-routed. Otherwise, the servers are not the problem. To stop the ping request press Crtl + C on the terminal.
6. Disable Your Antivirus Software or Firewall
Antivirus programs and firewalls serve as protective barriers against potential threats to your system. However, there are instances where they may misinterpret a secure connection as a potentially harmful one, resulting in the ERR_CONNECTION_CLOSED error.
Here’s a step-by-step guide to determine if your security software is causing this obstruction:
-
-
- Temporarily disable Antivirus Software
- Test using your browser by visiting the website again and if the error disappears that means antivirus is the cause of the problem.
- Add the website to the exception list of the antivirus software.
- Temporarily disable your firewall, If you’re using Windows, you can do this by going to the Windows menu > Settings > Updates & Security > Windows Security > Firewall & Network Protection > Microsoft Defender Firewall. Choose the network type and then flip the switch to turn Windows Defender Firewall on or off.
On Mac OS: Click on Apple menu icon>System Settings>Network>Firewall>Toggle it off - Check the Connection with the firewall turned off, and try accessing the website again if it is accessible then the firewall might be the reason behind the blocker connection.
- Adjust the settings of your firewall so that your browser can access the internet freely, you can create specific rules, and create exceptions/whitelists for the browser.
-
7. Disable VPN Service or Proxy Server
Disabling your VPN service or proxy server may resolve the ERR_CONNECTION_CLOSED error. These tools, while beneficial, can sometimes disrupt website connections. To troubleshoot, temporarily disable them and check if the error persists. If it disappears, it indicates that either the VPN or proxy server was causing the issue.