Tutorials Archive Save and Share your Tutorials

13Sep/090

How To Block Websites, Blocking websites using hosts file

I recommend saving a copy of the Hosts file, and hiding it somewhere on the computer,
this will become our back up copy should we ever need one

Ok first off we need to open the correct file. let's do that now.

  1. open C drive or your designated hard drive, which is D drive for some user's.
  2. go to the windows folder and open it
  3. now open the system32 folder
  4. open the drivers folder
  5. open the etc folder
  6. now we see a file called hosts. we need to right click on this file and choose open
  7. with. choose open with, select from list, and we use notepad to open the file.
  8. we need to scroll down where we see 127.0.0.1 localhost
  9. skip a line under 127.0.0.1 localhost.
  10. this line should be empty, and under this line here, we will start blocking sites.
  11. now we will enter, 127.0.0.1 www.sitename.com #blocked, do not add http://
  12. click the close button when your finished and say yes when asked to save changes.

Example of a host file with blocked sites:

# Copyright © 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

127.0.0.1 www.myspace.com #blocked

127.0.0.1 www.tutarchive.com #blocked

127.0.0.1 www.facebook.com #blocked

you get the point now. Just be careful not to remove the "127.0.0.1 localhost" line if you're removing entries.

Basically, the "127.0.0.1 www.facebook.com" line links the "www.facebook.com" domainname to the 127.0.0.1 IP address, which is always your own computer (=the local host/computer). So any data going to www.facebook.com will go to 127.0.0.1 and simply be discarded.

i used the "#" (pound sign) blocked to let me know i blocked them, but that is optional.
notice no pound sign's in front of my entries, that is because these are active entries, that the computer will read.
everything else that has a pound sign in front of it, is just a comment, and the computer will not recognize that as a command.

Vista: Users must run Notepad as admin then navigate to the host file. Be sure all files is selected from the drop down menu so you can see the host file.

VN:F [1.6.4_902]
Rating: 0.0/5 (0 votes cast)
VN:F [1.6.4_902]
Rating: 0 (from 0 votes)

Related posts:

  1. Download Your Facebook Photo Albums (or that of your friends) With a Click
  2. How to copy text or images when right click disabled in website
  3. Linux File System Explained For Beginners

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.

Subscribe via Email

Follow me on Twitter

Categories

Archives

Calendar

September 2009
M T W T F S S
    Feb »
 123456
78910111213
14151617181920
21222324252627
282930  

Recent Posts

Recent Comments

Link Exchange

Meta

Stats

Web Directory

Internet photoshop tutorials, free photoshop tutorials, tutorials, tutorial search, tutorial links, find tutorials, photo shop tutorials, html tutorials,
blog directory Internet Blogs - BlogCatalog Blog Directory
TopOfBlogs