This article is unavailable in Arabic. Showing in English instead.

Fix ERR_CONNECTION_REFUSED issue if nothing else works (Mac)

Fix ERR_CONNECTION_REFUSED issue if nothing else works (Mac)

So you tried clearing your cache, changing DNS to 8.8.8.8, delete all history data, cookies, extensions and you are able to visit that website from your mobile device?

Before tackling this problem, it's important to understand why this error has occurred at the first place.

When you get to see the error ERR_CONNECTION_REFUSED appearing on Google Chrome, it's a sign that your browser is blocking the connection between your machine and the server to which the website belongs. There are many reasons why this error appears, but in this article, I am assuming you have tried all or most of the following:

  1. Tried visiting website in Incognito Mode
  2. Force refresh (cmd/ctrl + Shift + R)
  3. Delete cache files
  4. Delete all browser data including history, passwords, cached files, cookies etc
  5. Disable/Remove all extensions
  6. Reboot your Router
  7. Reboot your Computer
  8. Change DNS address to 8.8.8.8
  9. Change your IP address

If you tried all the above, and none of the browsers from your Mac seem to be able to visit that website, but you are able to do so from your phone and other devices from the same network, then the next solution will most likely help you.

  1. Click on your Desktop and navigate to Go > Go to Folder ... from the main menu bar on the top of your screen, or press command + Shift 6 keys from your keyboard.

  2. type the following path /etc/hosts and press Go. This will take you inside the etc folder within the private directory and the hosts file should be highlighted.

  3. The Private directory contains configuration files which are reserved by your operating system. File like these include system logs (error windows showing up in your screen), memory swapping, configurations for command line tools etc. By any means, you should not rewrite any of these files, move or delete them. Although some of them are regenerated when you reboot your system, but there is always a possibility that you may ruin your machine. However, if you follow my steps strictly, none of the above will happen.
  4. From the etc folder, press the keys commandup arrow key to move up a folder.

  5. Now you should see 4 or so folders (directories) within the private folder. Right click on the etc folder and from the menu, choose Get Info.

  6. A window should appear. This displays some of core information (meta data) about that folder. From here, we need to change the permissions so we will be able to do any changes (write) on any files within that folder. To do that, go to the bottom of the window where it says Sharing & Permissions and click on the little locker on the bottom right. You may need to enter your password for this.

  7. Now on the everyone section, click on the Read only arrows pointing both up and down. A small dropdown should appear on the left. Choose Read & Write.

  8. Click on the yellow locker (on the bottom right of the window) to save the changes you just made. Then double click on the etc folder to open it again and scroll down until you find the hosts file. Once you find it, right click on it and from the drop down menu choose Get Info.

  9. Repeat the process from steps 6-7 to enable Read & Write privileges to the hosts file. Don't forget to lock the locker on the bottom right to save the changes.

  10. Right click again on the hosts file and open it with TextEdit. A new window should open.

  11. On the new window opened, you should be able to make changes. In my case, I was having trouble opening the techlunar.com website, and hence I will remove the line containing "techlunar.com". The hosts file works by manually converting domains into specified IP addresses without the need of the browser to look them up through in the DNS (Domain Name Server). As you may see below, when I type "techlunar.com" on my favourite browser, the browser thinks I typed 127.0.0.1 meaning that the browser doesn't look into the DNS to find the equivalent IP address of where the "techlunar.com" is located. The reason why techlunar.com was there was either I manually modified the file sometime in the past or it was automatically added there by a 3rd party software somehow.

  12. After that, save and close the window.


    Now you may change the privileges again on both hosts file and etc directory back to Read only. Follow steps 6-7 but instead, Choosing Read Only instead of Read & Write.
  13. Visit the website again on your favourite browser. In case it doesn't work, then make sure to delete any cache files from your browser.

That's all! I hope I manage to resolve your issue after me spending a few days trying to figure out why I couldn't visit techlunar.com.

Please, let me know whether you found this article helpful and if you did, don't forget to share it so more people become aware of this.

Furthermore, we love feedback as much as producing these articles. If you have any feedback you would like to share, don't hesitate to leave it in the comment section below!

إعجابات 2497 مشاهدين

عن المؤلف

...
George K.

Admin of TechLunar

التعليقات

ترتيب:

عرض:

الأحدث

حار الآن

المزيد من how-to

شعبية

X

هل تريد حقًا إزالة هذا التعليق؟ سوف تختفي إلى الأبد!

هل ترى شيئًا مريبًا أو غير مناسب في هذا التعليق؟ دعنا نعرف!


كاتيون:

نحن نأخذ التقارير على محمل الجد للحفاظ على السلام في هذا الموقع. انقر فوق الزر إرسال فقط إذا كنت تعتقد حقًا أن هذا التعليق لا يتبع القواعد وفقًا لما يلي . privacy إذا أدركنا أنه لا يوجد شيء لا يلتزم بقواعدنا ، اعتمادًا على الموقف ، فقد تفقد القدرة على الإبلاغ عن المحتوى.

أقر بذلك وألتزم بالقواعد

ملاحظة

أرسل لي مشكلة!