Then, move your cursor to the last line and add all websites you’d like to block following this structure: 127.0.0.1 Once you’ve added all websites, save your edits and exit the file. Open your terminal and type the following command: sudo nano /etc/hosts You won’t even be able to start loading the page.įor macOS users, things aren’t much different. If you’ve done everything right, you shouldn’t be able to access any website on the list from any browser.