How to modify the hosts file on Apple computer! Where is the Mac's hosts file?

The hosts file is an important file for us to surf the Internet. Modifying hosts can help us speed up domain name resolution, block websites, and so on. However, many Apple computer users do not know where the hosts file is in the macOS operating system. Today I will tell you how to find and modify the hosts file in a variety of ways.

  method one,

  1. Click the [finder] function in the lower left corner of the mac computer desktop;

  2. After opening the finder, press the keyboard shortcut [shift+cmd+G] and enter [/private] to open a new page. Right-click on [etc] in the private page, and select [Display Introduction];

  3. Then modify the permissions of the etc folder and enter the password to complete the login;

  4. Change the permissions in [Sharing and Permissions] to [Read and Write];

  5. Open the [hosts] file in etc, select [Display Introduction], and modify the file permissions to [Read and Write];

  6. After that, open the hosts file and enter the host information to complete the modification and save.

  Method Two,

  1. Click the [terminal] icon on the desktop to open the terminal;

  2. Enter [vim /etc/hosts], then the vim editor will open the hosts file;

      3. Enter the host address directly, then save and exit.

  The above are the two different ways to modify the hosts file on the mac. I hope it will be helpful to all of you.

Guess you like

Origin blog.csdn.net/weixin_51245542/article/details/113552084