Saltar al contenido
Blog

Pastebin ERR_CONNECTION_REFUSED: check your hosts file

pastebin.com showing ERR_CONNECTION_REFUSED or ERR_NAME_NOT_RESOLVED on one PC? Check the Windows hosts file for a 127.0.0.1 line, then the other causes.

The Liite team8 min de lectura

Short answer

If pastebin.com fails on one computer but loads on your phone, open the Windows hosts file as administrator and look for a line containing pastebin. Delete it or put # in front of it, save, and flush DNS with ipconfig /flushdns. If the file is clean, test another network, because a router, ISP, school or country block is the next most likely cause.

pastebin.com won't open on your PC, your phone loads it fine and other sites work. Chrome or Edge shows one of these:

ERR_CONNECTION_REFUSED

or

ERR_NAME_NOT_RESOLVED

Why Pastebin won't load

When you type a site name, your computer looks up its address. Before Windows asks a DNS server, it reads a plain text file called hosts. If that file maps a name to an address, Windows uses that answer and never asks DNS.

People in Reddit's tech support and Pastebin communities report that the hosts file on the affected PC contained a line sending pastebin.com to 127.0.0.1. That address always means "this computer". The browser connects to itself, nothing is listening, and Chrome shows ERR_CONNECTION_REFUSED. Google's own Chrome help describes that error in general terms as the page didn't let Chrome connect or the page is blocked.

Those reports also say the line sat next to blocks for other sites, such as Dropbox and piracy sites. That points to something editing the file: a blocking tool, a "debloat" or privacy script, parental-control software, or an installer. The threads don't establish which one did it in any given case, so treat the source as unknown until you look at your own file. The reports date from 2020 and 2021, so check your own machine rather than assuming.

ERR_NAME_NOT_RESOLVED is a different failure: the name lookup itself fails. That points to DNS, a filter or a network block more often than to the hosts file. Because it is a lookup failure, it is worth testing on another network.

Chrome's help page lists the usual families of causes for connection errors: device settings, firewall or antivirus, modem or router, browser issues, and website downtime.

CauseTypical symptomFix
hosts file line to 127.0.0.1Only this PC fails; phone worksRemove the line
Router, ISP, school or office filterEvery device on that network failsTry another network; ask the network admin
Country-level blockFails everywhere in the countryReports mention Turkey; use a different route or a different paste host
Antivirus or firewall web shieldFails in every browser on this PCAdd an exception for the site
Proxy or VPNFails only while it is onTurn it off or fix its settings
Pastebin outageFails on every device and networkWait and retry

Fix 1: remove the line from the hosts file

This fix is for Windows. The file is at:

C:\Windows\System32\drivers\etc\hosts

It has no file extension.

  1. Open the Start menu, type Notepad, right-click it and choose Run as administrator. Accept the UAC prompt. Without admin rights you can open the file but not save it.
  2. In Notepad, choose File > Open and paste C:\Windows\System32\drivers\etc into the file name box, then press Enter.
  3. Change the file type filter from *Text Documents (.txt) to All Files** so hosts appears, then open it.
  4. Look for any line containing pastebin. A blocking line looks like this:
127.0.0.1 pastebin.com
  1. Also look for 0.0.0.0 pastebin.com and www.pastebin.com variants.
  2. Delete the line, or put # at the start to turn it into a comment. Lines starting with # are ignored.
  3. Choose File > Save, then close and reopen your browser.
  4. Open Command Prompt and run ipconfig /flushdns to clear the cached lookup.

Tip

A default hosts file is mostly lines starting with #. Any line without a leading # is something that was added later, so those are the ones to review.

If Notepad refuses to save

If you get a permission error even though Notepad says administrator, you probably opened the file from Explorer rather than from inside the elevated Notepad. Close it and open it through File > Open in the elevated window, as above. A fallback is to copy the file to your desktop, edit the copy, then copy it back over the original and approve the admin prompt.

If the line keeps coming back

Something is rewriting the file. Read the rest of the file, work out which tool added those entries (a blocker, a debloat script, parental controls or a security suite), and decide whether to keep it. Removing the pastebin line while the tool still runs will only last until its next refresh.

Warning

Read the whole file before you delete anything. A blocking tool may have added dozens of lines, and you should remove only the ones you actually want gone.

If the file has no pastebin line, the hosts file isn't your problem and you can move on.

Fix 2: find out whether it's your device or your network

  1. Open pastebin.com on your phone over mobile data. If it loads there but not on the PC, the problem is on the PC.
  2. Then put the phone on the same Wi-Fi as the PC. If it fails there too, the router, ISP or network filter is the cause.
  3. If the whole network is blocked, a school or office admin is the person to ask. At home, check your router's parental-control or filtering settings.
  4. If you are in a country that restricts Pastebin, you can't fix this from the PC. Reports mention Turkey.

Fix 3: rule out the browser, security software and proxies

  1. Open the page in Incognito mode. Chrome's help says to exit Incognito and move on to disabling extensions or deleting browsing data if that fixes it.
  2. Try a different browser. If it works there, suspect an extension or proxy setting in the first one.
  3. Disable extensions, then re-enable them one at a time to find the culprit.
  4. Check your firewall or antivirus. Chrome's help tells you to make sure any firewall or antivirus software isn't blocking your connection. Pause web protection briefly to test, and if that fixes it, add an exception rather than leaving protection off.
  5. Turn off any VPN or proxy and reload. A misconfigured one can refuse connections to specific sites.

Chrome's full list of steps is in Fix connection and loading errors in Chrome, and its error summary is at Get help with common error messages in Chrome.

What won't help

  • Reinstalling your browser. The hosts file belongs to Windows, so a new browser reads the same file.
  • Changing DNS servers to 8.8.8.8 or similar. The hosts file is read before DNS, so this does nothing for a hosts-file block. It can only help if your ISP's DNS is what refuses the name.
  • Resetting the router. If the block is on the PC, the router isn't involved.

Checklist before you try again

  • The hosts file was opened from an elevated Notepad and saved without an error.
  • No line containing pastebin is left without a leading #.
  • You ran ipconfig /flushdns and restarted the browser.
  • The site loads on your phone over mobile data, so you know it isn't down.
  • VPN, proxy and extensions were off for the test.

If nothing works

Contact whoever controls the blocking layer. At home that is your ISP or router vendor. At work or school it is the IT admin. If Pastebin fails on every device and every network, check the site's own status channels, since we can't tell you its current state. Include the exact error, the time, the network you tried and what you already ruled out.

Hi, pastebin.com fails to open on my PC with ERR_CONNECTION_REFUSED
(Chrome, Windows). It loads on my phone over mobile data. I checked
C:\Windows\System32\drivers\etc\hosts and removed any pastebin entry,
ran ipconfig /flushdns, and tried another browser and with the VPN off.
It still fails on [home Wi-Fi / office network] at [time and date].
Can you check whether pastebin.com is being blocked or filtered on
this connection?

If you only need to share some text

If you just need to hand someone a snippet while Pastebin is out of reach, Liite has a paste tool at /new. A basic paste needs no account and lasts up to 7 days, with no syntax highlighting, so it suits notes and plain text better than code. If the problem is a network block, test liite.co from your own network first. The Liite vs Pastebin comparison covers the differences.

Common questions

Can a hosts file edit really block just one site?

Yes. Each line maps one name to one address, so a line like 127.0.0.1 pastebin.com affects only that name. Other sites keep working, which is why the problem looks so odd.

Does this apply to Mac or Linux?

Both have a hosts file too, but the path and the way you edit it differ, and the steps above are for Windows. The idea is the same: look for a line that points the site to 127.0.0.1.

Is it malware if the line is there?

Not necessarily. Blocker tools, parental controls and debloat scripts all edit this file on purpose. If you don't recognize any of the entries, run a scan with your security software.

Why does my phone work but my PC doesn't?

Your phone has its own DNS settings and no copy of your PC's hosts file. That difference is exactly what points to a PC-level cause.