What the editor is talking about here is to block specific websites by modifying system files (of course there are other ways, such as: 1, create a new login account, and then perform parental control; 2, install third-party application software Self Control; 3, other methods).
The screenshot of Xiaobian's system information is as follows:
Step 1: Open a terminal
Step 2: Enter sudo pico /etc/hosts in the terminal
After entering sudo pico /etc/hosts, then "Enter", then you need to enter the login password of the account.
Then enter text editing:
move the cursor to the last line.
Step 3: Add the website address that needs to be blocked
In the cursor position of the text editor opened in the second step (it has moved to the end), enter:
127.0.0.1 www.bilibili.com
(the website www.bilibili.com is blocked here)
Note: Do not have "http" in front of the URL ://"
Note: Do not have "http://"
in front of the URL Note: Do not have "http://" in front of the URL,
then press Ctrl+O to save the modification,
then press "Enter" to confirm the modification
and then press "Ctrl+X" Exit the text editor and go back to the terminal.
Step 4: Update the cache
Type: sudo dscacheutil -flushcache
and press "enter"
At this time, if the above operations are not wrong, the "www.bilibili.com" website should have been blocked.
other instructions
Article reference: https://www.igeeksblog.com/how-to-block-websites-on-safari-on-mac-os-x-yosemite/