

At the bottom of the last line, type in the localhost IP address 127.0.0.1, and after pressing Tab for space, type the domain name of the site you want to block.It should consist of several lines similar to the one on Windows. Enter the administrator password to open your hosts file.Your hosts file will open up in a nano box. In the Terminal command, type sudo nano/etc/hosts.If you have macOS, blocking websites on Chrome through the hosts file has a similar process.įor more information, follow the steps below: Click Apply, and you should have access to edit the hosts file.In the pop-up window that appears, tick the Full Control box under Allow.


