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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s