; Go to the folder.2. Enter \"/private/etc/hosts\" and click Go.3. Automatically open the \"etc\" fo" />
1. First, open a folder and click "Go->; Go to the folder.
2. Enter "/private/etc/hosts" and click Go.
3. Automatically open the "etc" folder, find the hosts file and drag it to the desktop, that is, copy a host file to the desktop, thus modifying the hosts file on the desktop.
4. "Right-click" the hosts file on the desktop, select the application to open the file, and use text editing to open it.
5. You can start editing the following host file.
6. After editing, you can drag the hosts file on the desktop back to the "/private/etc folder" and a query box will pop up. Click OK and Replace.
Method 2
Click the magnifying glass "Search" in the upper left corner of the desktop, enter "End" or "$ term" to display "Terminal", and then turn it on.
Enter "sudo vi /private/etc/hosts" after opening, and press "Enter" to pop up and ask for the administrator password. This password is the password entered when logging in to OS X at the time of opening. Just press "Enter" directly after entering. If the administrator password is not set, the user will enter "vi /private/etc/hosts" when opening it, and Kengwei has the problem of insufficient authority.
After opening, enter the editor, move the last line, and press the "O" key on the keyboard to jump to the input state of the next line. So you can start editing the hosts file.
Edit the hosts file, press the "Esc" key on the keyboard, enter ":wq" to save it automatically, and then you can end the editor.
This completes the editing of the host file.