Channel Button

There are 4 articles on this title. You are reading the article ranked and rated #2 by Helium's members.

Computers & Technology   >

Internet Security & Safety (Other)

Get a Widget for this title

How to block a website

Blocking a website on a Windows XP machine (please see note at end for Vista) is MUCH easier than you'd expect, and it can block most technically unsavvy people. All that's required is your ability to understand how the process works, and ability to type accurately (slowly is fine).

First of all, you need to understand HOW a web browser such as Internet Explorer fetches a webpage, when you enter an URL such as http://www.helium.com

The computer takes the www.helium.com, and consults a "DNS server". DNS stands for domain name service. It gets back the server's actual IP number. The browser then goes to the server via the IP number to request the webpage. It's a multi-step process.

Thus, to block a website, the easiest way is to force DNS to return a bogus result. And the way you do that is with a HOSTS file.

The Hosts file contains mappings of IP addresses to respective domain names. This file is loaded into system memory at startup, and Windows checks the Hosts file before it queries any DNS servers, thus, by changing the HOSTS file, we can override access to certain websites.

Now let us examine what a HOSTS file looks like:

#file starts here
127.0.0.1 localhost
127.0.0.1 ad.a8.net
127.0.0.1 asy.a8ww.net
127.0.0.1 abc-search.info
#file ends here

Note that I added the #file starts / ends here lines.

First is the IP address, always 127.0.0.1 here. Second is the domain name (do NOT put http prefix), and any after that, after the #, is a comment.

127.0.0.1 is your own PC. It's also known as "localhost". Since YOU are not running a webserver, any attempt to go to any of the listed websites will be directed to your own PC, and it will come back with a "web server not responding".

If you don't have such a file, just create one with notepad, by copying the one we have here. Save it into your C:\WINDOWS\SYSTEM32\DRIVERS\ET C directory (for WinXP)

To add a website to block, just add another line, type in 127.0.0.1, type in the domain name, then save the HOSTS file, and restart the system. The website should no longer be accessible after that.

To UNDO the block, remove the line from the HOSTS file, and restart the computer.

Vista Users: you may not have the rights to modify HOSTS file. Consult your administrator if you are unable to modify this file.

Windows 2000 users: the file should go into C:\WINNT\SYSTEM32\DRIVERS\ETC

E njoy the free blocking ability.

Learn more about this author, K. Charles.
Contact this writer Click here to send this author comments or questions.


Below are the top articles rated and ranked by Helium members on:

How to block a website

  • 1 of 4

    by Chris Scott

    Blocking a website in the Firefox browser is easy. First of all, you'll need the Firefox web browser (www.mozilla.com), and

    read more

  • 2 of 4

    by K. Charles

    Blocking a website on a Windows XP machine (please see note at end for Vista) is MUCH easier than you'd expect, and it can

    read more

  • 3 of 4

    by Daniel Bull

    The safest way to protect your family from harmful sites is to BLOCK the site. Until recently, trying to block websites was

    read more

  • 4 of 4

    by Jeff Barron

    Very simple way to block any website just by using Windows.

    Windows XP has a file called HOSTS in the directory C:\WINDOWS\SYSTEM32 \DRIVERS\ETC\

    read more

Add your voice

Know something about How to block a website?
We want to hear your view. Write_penWrite now!

176597

Featured Partner

New England Coalition for Sustainable Population (NECSP)

New England Coalition for Sustainable Population's (NECSP) mission is to raise awareness in New England of regional, ...more

What is Helium? | Buy Web Content | Contact Us | Privacy | User agreement | DMCA | User Tools | Help | Community | Helium’s Official Blog | Link to Helium

Helium, Inc.
200 Brickstone Square Andover, MA 01810 USA