How to fix hosts file on Mac

File hosts on the system help users to intervene deeply into the computer, support users to change the system such as blocking ads from certain websites or software such as blocking ads on Viber, or blocking websites. browser, even support access to blocked websites, .

File hosts on all operating systems allow users to change, edit, add commands to meet the purpose we want to perform. To edit the hosts file on Mac, users also need to follow each step in the order as when editing the hosts file on Windows 10 or changing the hosts file on Linux. The following article will guide readers to change the hosts file on a Mac.

  1. 5 ways to block websites and limit usage time on Linux computers
  2. How to open the hosts file on Windows
  3. How to reset HOSTS files on Windows 7/8 / 8.1 and Windows 10
  4. How to create a new host file on Windows

Instructions to edit the hosts file for Mac

Method 1: Edit the hosts file on Mac via etc

Step 1:

First we press the key combination Command + Shift + G to display the directory access dialog. Next we enter / etc into the search field and click Go to continue.

How to fix hosts file on Mac Picture 1

Step 2:

Show etc folder with many files inside. Users browse to fie hosts and then double click to open and edit and save.

In case the hosts file does not save, we overwrite the content, the user moved that hosts file to the desktop or another directory to edit. Then copy to the etc directory to overwrite the existing hosts file.

How to fix hosts file on Mac Picture 2

Method 2: Edit the hosts file on the Mac via Terminal

For Mac OS, we have more ways to fix hosts file via Terminal.

Step 1:

Users access to Utilities folder and then click on Terminal in the list to launch. Or we press the keyboard shortcut Commnd + Space and then type the keyword Terminal to open up.

How to fix hosts file on Mac Picture 3

Step 2:

In the interface shown, enter the command sudo nano / private / etc / hosts and then type the password of the Mac into the Password line below. Click Return to open the hosts file.

How to fix hosts file on Mac Picture 4

Step 3:

Display the hosts file interface for users to edit. We use the left and right up and down arrows to move the cursor to where the content of the hosts file needs to be edited.

How to fix hosts file on Mac Picture 5

Step 3:

Once finished editing, we press Ctrl + X and then press Y to agree to save new content to the hosts file. Finally press Return to agree or press N to not save the content.

How to fix hosts file on Mac Picture 6

So we have 2 different ways to edit the hosts file, change the content of the hosts file on the Mac. If you edit the hosts file via etc, it is best to copy the file to another location for editing and then copy the etc folder again to overwrite the existing file.

I wish you successful implementation!

3.8 ★ | 10 Vote

May be interested

  • How to fix the hosts file on Windows 10How to fix the hosts file on Windows 10
    sometimes, for some reason, you need to edit the host file on your computer, but you cannot edit because when saving the host file, you don't know how to open the host file…. if you do not know how to edit the host file on windows, then you please
  • Edit Hosts file to access Facebook 2014Edit Hosts file to access Facebook 2014
    sometimes due to the fault of the network provider, you cannot access facebook, i will guide you to fix the host file in windows so that you can log into facebook stably.
  • Fix the error that the host file cannot be saved on Windows 7, 8, 10 - How to fix the hosts fileFix the error that the host file cannot be saved on Windows 7, 8, 10 - How to fix the hosts file
    fix the error that the host file cannot be saved on windows 7, 8, 10 - how to fix the hosts file
  • How to Edit Host File on Win 10, 7 Fastest 2024How to Edit Host File on Win 10, 7 Fastest 2024
    you already know all the uses and how to edit the host file on win 10, 7 simply, please refer to hoang ha pc's article!
  • How to open the Host file on Windows 10, edit the hosts fileHow to open the Host file on Windows 10, edit the hosts file
    how to open the host file on windows 10 helps users to edit the host file, manage access to web sites on computers and laptops. the following article will guide you how to open and edit the host file on windows 10 simply and quickly.
  • How to Block and Unblock Internet Sites (On a Mac)How to Block and Unblock Internet Sites (On a Mac)
    blocking certain websites can keep you productive during the workday, or minimize the chance of your child finding adult content. you can create a website 'blacklist' for your mac in several ways. while the built-in parental control...
  • Installing and configuring the 2004 ISA Server Firewall - Chapter 2 Installing Certificate ServicesInstalling and configuring the 2004 ISA Server Firewall - Chapter 2 Installing Certificate Services
    microsoft certificate services can be installed on the domain controller of the internal network and provide certificates to hosts on the internal network domain, as well as hosts that are not members of the internal network domain.
  • How to Fix Error 3194 on iOSHow to Fix Error 3194 on iOS
    when you experience error 3194 in itunes, you are not properly connecting to apple's firmware signature verification server. this typically happens because you've jailbroken your device in the past and have changed the way itunes connects...
  • What is ISO file?What is ISO file?
    an iso file, often called an iso image, is a single file, replacing all cds, dvds or bds. the entire contents of the disc can be accurately copied in a single iso file.
  • How to Block a Website on All Web BrowsersHow to Block a Website on All Web Browsers
    today's wikihow will show you how to prevent all browsers from accessing a specific website on your windows or mac computer by editing the 'hosts' file. additionally, while it's not possible to block websites on the android platform, you can still do so on your iphone or ipad using the restrictions menu in the settings app.