Tutorial on modifying Hosts file on macOS:Easily manage network access permissions

Modifying the Hosts file on a Mac computer can effectively control network access and solve DNS resolution problems。The following is a detailed modification tutorial:

1. Find the Hosts file

•Open Finder,Click the "Go" menu at the top,Select "Go to Folder"。

•enter /etc and press enter,Find and double-click to open the folder。

2. Back up Hosts file (optional)

• Found in the pop-up window hosts document,Right click and make a copy as a backup,In case the error can be restored after correcting it。

3. Edit Hosts file

•Will hosts Drag the file into a text editor (such as TextEdit、Sublime Text, etc.)。

•Add or edit the IP address and domain name information you need at the end of the file,The format is:IP address domain name,One entry per line。

4.Save changes

•After completing modifications,keep hosts document。If you are prompted for insufficient permissions,You can save the file as on your desktop,then drag it back /etc folder and overwrite the original file。

5. Flush DNS cache

Sudo Killall -hup Mdnsresponder

• Open the Terminal application (found in Utilities in the Applications folder),Enter the above command and press Enter key。

My WeChat account
Scan on WeChat
weinxin
My WeChat account
WeChat ID has been copied
My WeChat public account
Scan on WeChat
weinxin
My official account
Official account has been copied
 
  • By Published on2026January 21 12:15:45
  • Please be sure to keep the link to this article when reprinting it:https://hqcj.com.cn/2026/01/21/350.html
  • Tutorial on modifying Hosts file on macOS
anonymous

Comment

Anonymous
Decide

Slide puzzle verification.