
Sometimes we have to block some websites in your PC at home or office reason maybe anything like some site are hamrful and unwanted to us so today iam going to teach an easily and effectively way to block access to the website by editing HOSTS file.this is very easy way and work 100%,below is the trick to Block a website in your PC.
Step1: Go to your HOSTS file which is located at:
C:WINDOWSSYSTEM32DRIVERSETC for windows Vista and XP
C:WINNTSYSTEM32DRIVERSETC for Windows 2k
C:WINDOWS for Windows 98 and ME
C:WINDOWSSYSTEM32DRIVERSETC for windows Vista and XP
C:WINNTSYSTEM32DRIVERSETC for Windows 2k
C:WINDOWS for Windows 98 and ME
Step2: Open HOSTS with Notepad.
The default Windows HOSTS looks like this:
# Copyright (c) 1993-1999 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
127.0.0.1 localhost
_____________________________
Step3. under the line that says 127.0.0.1
For example to block the facebook.com
simply type:
127.0.0.1 facebook.com
127.0.0.1 www.facebook.com
You may need to add sites with both with and without the “www.”.
Test after blocking to make sure you got it right or not.
You can add as many sites as you wish on HOSTS file.
Step4. Save the file thats all.
Now this look like :
________________________________________________________________
# Copyright (c) 1993-1999 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
127.0.0.1 facebook.com
127.0.0.1 www.facebook.com
___________________________________________________________________
Your done!
If you try to access the site which you blocked then you will see error saying “The page cannot be displayed” or something like that.
How to Unblock the site blocked by host file?
Just remove
127.0.0.1 facebook.com
127.0.0.1 www.facebook.com
from the file and save it.
No comments:
Post a Comment