There is an old Linux trick, that works superbly in Windows as well.
1. It is necessary to run notepad or your Windows editor of choice as the Administrator. Right click on notepad in the start menu, and choose: Run as Administrator.
Once you do that, navigate to the Windows host file. Don’t know where that is? I will tell you!
c:\windows\system32\drivers\etc\hosts
2, Once you have that open, click on file, and then save as hosts.org. That makes a copy of the intact original file.
Your file needs to look like:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# define local host GU 09/26/2012
127.0.0.1 localhost
::1 localhost
# add sites to be blocked GU 09/26/2012
127.0.0.1 facebook.com
127.0.0.1 twitter.com
127.0.0.1 youtube.com
127.0.0.1 pandora.com
Notice the the definition for 127.0.0.1 (localhost) was UNCOMMENTED. Very important. Also ::1.
Now you just tell it what sites you want to block, (as seen here, facebook, twitter, youtube, pandora) — whatever you want blocked.
3. Now hit file, and SAVE AS as hosts. Overwrite the file. I rebooted Windows and guess what? No more access to those sites!
4. To check:
ping youtube.com
PING youtube.com (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_req=1 ttl=64 time=0.027 ms
You can do the same thing in Linux, by editing /etc/hosts.
Wayno
Related Articles
No user responded in this post