How to restore default hosts file on Mac OS 2024

The contents of the hosts file can be edited by installing special applications such as Adobe for Mac. Even though we have uninstalled the application on Mac, the hosts file still has redundant content, which may affect the server connection of other applications later. Lucid Gen will guide you to restore the hosts file on Mac to default.

What is the hosts file on Mac for?

The hosts file on Mac sets whether or not to allow applications to connect to other servers. It is also used to create local connections for offline applications. Some everyday use cases include preventing applications from automatically checking for copyright or automatically checking for updates.

Default hosts file content on Mac

This is the default content of the hosts file on Mac. In addition to these lines, other lines are added by the applications themselves.

##
# Host Database
#
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1	     localhost
255.255.255.255	broadcasthost


::1		    localhost

How to restore hosts file on Mac

To restore the hosts file on Mac quickly, you need to follow these steps:

Step 1: Go to the hosts file on Mac using Finder. Open Finder > press Command Shift G > paste the path /private/etc/hosts and Enter.

Path to the hosts file on Mac
Path to the hosts file on Mac

Step 2: Copy the hosts file to another place, such as Desktop or Documents. Because you do not have permission to edit the hosts file on Mac directly in the etc folder, this step is similar to backing up the hosts file on your Mac.

Copy (backup) hosts file on Mac
Copy (backup) hosts file on Mac

Step 3: Restore the hosts file on Mac to the default content that Lucid Gen provided above.

Edit hosts file on Mac
Edit hosts file on Mac

Note: If you know clearly what content in the hosts file is necessary for your application, then keep that content below the default content.

Step 4: Replace the new hosts file into the etc folder by copying and pasting. When the confirmation dialog box appears, select “Replace” and enter your password to open the device.

Restore hosts file on Mac
Restore hosts file on Mac

Step 5: Restart the computer to ensure the contents of the new hosts file have been applied on the Mac.

Conclusion

Restoring the hosts file on Mac can help fix errors where some applications cannot connect to their servers. This is the first thing you should do before you reinstall an application that interferes with the hosts file, or it should be done after uninstalling these applications.

Related articles

Hieu Tran Ngoc Minh

Hieu Tran Ngoc Minh

I am currently working as a Data Analyst; before that, I worked in Digital Marketing. Blogging is a joy, helping me share my knowledge and experiences from life and work. You can donate to me here.

2 thoughts on “How to restore default hosts file on Mac OS 2024”

  1. Do I need to edit the host file? Which line? Want to install Adobe software family on my mac Sonoma 14.2.1..

    Reply

Leave a Comment

Feel free to leave your comment, and we will review and respond as soon as possible. Please use a real email to ensure your comment is approved and to receive notifications when we reply. You can also add an avatar to your email.