Prevent your computer/browser from accessing certain websites without installing any apps or extensions
Back up the file we’ll modify:
$ cp /etc/hosts /etc/hosts.bak
Open the original file:
$ sudo nano /etc/hosts
Add the following line at the bottom of the file:
127.0.0.1 www.example.com
Save the file.
Close the file.
Note: you don’t need to append the URL of the website with https://.
You can also block websites from your router.
personal computing command-line interface (cli) gnu linux trisquel shell literacy wiki