How to block unwanted sites on linux?

/
0 Comments
In this post I'm going to show you a trick to block unwanted sites on your linux system. For this method we don't need any third party tool.
To block a site names "abc.com" follow these instruction:

Open the file /etc/host in any editor with root privileges. For that fire following command in terminal for debian based system like ubuntu:

sudo gedit /etc/host 

This will open /etc/host file in gedit.

At the end of this file add a new line entry like below:

127.0.0.1 abc.com

(Note: here replace abc.com with the domain name of the site which you want to block.)



And done .... now try to open that site on your browser and your browser will tell you "I'm unable to connect..." :D .


Make sure you are testing with exact domain name means if you have added entry of abc.com then it will not block www.abc.com . You have to add separate entry for www.abc.com....


You may also like

Popular Posts