Quick Tip: How to block a website URL in Linux

If you ever wanted to block access to a URL (for example, perhaps you want to prevent access to a website through a browser), you can accomplish this in an Linux environment by editing the /etc/hosts file. Simply add a new line to the file which includes the localhost address (127.0.0.1) and the URL you wish to block.

e.g.

127.0.0.1 offnadir.wordpress.com

Advertisements