What ERR_CONNECTION_REFUSED means
Chrome shows “This site can’t be reached” and “example.com refused to connect”, with the code ERR_CONNECTION_REFUSED. Edge shows the same under “Hmm… can’t reach this page”. Firefox shows “Unable to connect”.
A refused connection is a fast “no” from the other end. When nothing answers at all, the browser waits and shows a timeout instead: see how to fix ERR_CONNECTION_TIMED_OUT.
- The web server is stopped, so nothing is listening on the port.
- A firewall on the server or on your network rejects the connection.
- The address has the wrong port, or uses
https://on a server with no HTTPS set up. - The domain’s DNS points to an old server that no longer runs the site.
- A VPN, proxy or security app on your device blocks the site.
- The host blocked your IP address, often after failed logins.
- On
localhost, the local development server is not running.
If you are visiting the site
Find out whether the site is refused for everyone or only for you. Reload the page after each step.
- Check the address for typos.
- Remove any port number after the domain, such as
:8080, unless the site gave you that address. - Try
https://in place ofhttp://, or the other way around. - Open another website to check that your connection works.
- Open the site on your phone over mobile data. If it loads there, the cause is on your computer or network.
- Turn off your VPN.
- Turn off any proxy you did not set up: on Windows in Settings › Network & internet › Proxy, on a Mac in System Settings › Network › your connection › Details › Proxies.
- Clear cached images and files: press
Ctrl+Shift+Deletein Chrome, Edge or Firefox (Cmd+Shift+Deleteon a Mac). - Pause the web protection in your antivirus or firewall, and reload. Turn it back on afterward.
- Flush the DNS cache: run
ipconfig /flushdnsin Command Prompt on Windows, orsudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderin Terminal on a Mac. - In Chrome or Edge, open
chrome://net-internals/#dnsoredge://net-internals/#dnsand select Clear host cache. - Still refused only for you? The site may have blocked your IP address. Contact the site’s owner.
If it is your website
Test from another network too, such as mobile data, in case only your own IP address is blocked. Then check DNS, HTTPS and the server, in that order.
- Look up the domain with
dig example.com Ain a terminal (nslookup example.comon Windows). - Compare the result with the IP address in your welcome email or client area. cPanel also shows it under General Information.
- Before you change DNS, note the current records so you can switch back.
- If the IP address is wrong, fix the A record where your DNS is managed: how to connect a domain to your hosting.
- Delete any AAAA record that points to an old server. It can send some visitors to the wrong place.
- Run
curl -I http://example.comandcurl -I https://example.com. A quick “Couldn’t connect to server” or “Connection refused” confirms the refusal. - If
http://works buthttps://is refused, nothing answers on port 443. On shared hosting, open a support ticket. On your own server, see the next section. - If
https://loads with a certificate warning instead, run AutoSSL in cPanel › SSL/TLS Status. See how to fix “Your connection is not private”. - On shared hosting, check your email and client area for a maintenance notice from your host.
- If DNS is right and the site is refused from every network, open a support ticket with the domain, the time and the
curlresult.
Check the web server and firewall
On a VPS or your own server, the web server and firewall are yours to run. On shared hosting, your host runs them.
- Connect over SSH and run
sudo ss -tlnp. - Check that a program is listening on ports
80and443. - If nothing is, start the web server. With WHM, open Restart Services and restart the HTTP Server.
- Without WHM, run
sudo systemctl startwith your web server’s service name, such asnginxorapache2. - If it stops again, read the web server’s error log for the reason.
- If port 80 is listening but 443 is not, the web server is not serving HTTPS. With WHM, port 443 normally always listens: restart the HTTP Server in Restart Services and read its error log. Without WHM, add a port 443 server block (Nginx) or virtual host (Apache) with the site’s certificate, then reload the web server.
- Allow incoming TCP on ports 80 and 443 in the server’s firewall.
- Check any firewall or security group in your provider’s control panel too.
- Load the site from another network to confirm.
If your host blocked your IP address
Many servers block an IP address after repeated failed logins to cPanel, email, FTP or WordPress. The site then fails only on your network, with a refused or timed-out connection.
- Open the site over mobile data. If it loads there but not on your Wi-Fi, your IP address is likely blocked.
- Find your public IP address by searching “what is my IP”.
- Open a support ticket with your host and include that IP address. Use mobile data if the client area does not load.
- Once unblocked, update the saved passwords in your email apps, FTP client and phones, so old ones don’t trigger a new block.
Fix “localhost refused to connect”
On your own computer, this means no program is listening on that port. The local server is not running, or it runs on another port.
- Start your local server and check its terminal for errors.
- Using XAMPP or a similar app? Start its web server module in the control panel.
- Open the exact address and port the server prints when it starts, such as
http://localhost:8000. - If the port is taken, find what uses it with
lsof -i :8000on a Mac or Linux, ornetstat -ano | findstr :8000on Windows. - Stop that program, or start your server on a free port.
- Try
http://127.0.0.1:8000in place oflocalhost. Some servers listen only on IPv4. - In a container or virtual machine, make the server listen on
0.0.0.0and publish its port to your computer.
HostUpIndia Web & cPanel Hosting
HostUpIndia Web & cPanel Hosting runs on LiteSpeed with NVMe storage. Every plan includes cPanel for the DNS and SSL steps above, free SSL, terminal (SSH) access and daily backups kept 30 days.
Plans start at ₹49 a month on 3-year billing. Prices exclude 18% GST. See Web & cPanel plans.
- Moving from another host? The in-house team moves your site for you: free website migration.
- Support tickets and email are received 24 hours a day, 7 days a week; WhatsApp is open for questions from 10 am to 7 pm IST, Monday to Saturday.
- More help guides.
