You will have to edit the host file. Here I will show you how to edit it in Ubuntu. The format of the host file is same in linux or windows so you will be fine even in windows.
Open your terminal
Your hosts file may be read only. so change it to read write. To do so you have to type in the command
sudo chmod +w /etc/hostsOpen the hosts file to edit it. You may open it using the commands :
sudo gedit /etc/hostsYou will see following things in your file.
127.0.0.1 localhostIn windows 7, the hosts file is located at
127.0.1.1 abc-laptop
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
C:\Windows\System32\drivers\etcYou won't have the access to edit it. So in order to enable the editing:
right click on the hosts file
Click on properties
Click on Security
Choose your username then click edit
Check on the full control option.
Click on Apply and then on Ok
You can now edit the file.
What follows now is applicable to both windows and linux
You don't need to care about IPV6. Just ignore it. Now you need to add a line in the first block. Line to be added would be something like
127.0.0.1 www.facebook.comHere I used it to block facebook, instead you can replace www.facebook.com with any domain name you would like to be blocked. So your final file would look something like this
127.0.0.1 localhostNow save the file and close it.
127.0.1.1 mahesh-laptop
127.0.0.1 www.facebook.com
127.0.0.1 twitter.com
127.0.0.1 http://www.youtube.com
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
Congratulations! Your sites are blocked
No comments:
Post a Comment