blocking a website

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Baktash

Thread Starter
Joined
Jan 9, 2003
Messages
77
for some personal reason i want to block a website. But the problem is that if i add the website to the restricted sites in the explorer, the person who types the address of the site will know that it's added to the restricted sites. I want to block it in a such a way that the user think that there is some problem with the website or internet.
 

Brooks

Guest
Joined
Oct 30, 2001
Messages
2,323
Try creating an entry in the hosts file directing the site to a non-existent page.

Here is an example of the contents of the hosts file, redirecting yahoo to the local host ip address, which in IE will either have it do search for the site, or return a page cannot be found error (depends on how the options for IE are set).

# 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
127.0.0.1 yahoo.com
 

Baktash

Thread Starter
Joined
Jan 9, 2003
Messages
77
but where can i find the "host file" actaully i dont know much about computers can you tell me in simple terms

Thank you very much
 

Brooks

Guest
Joined
Oct 30, 2001
Messages
2,323
Open up explorer and do a search for hosts on the C drive.

Then open the file in notepad and edit it. Save the file and reboot the system.
 

Brooks

Guest
Joined
Oct 30, 2001
Messages
2,323
I forgot to tell you that the hosts file does not have an extension, and is in a subfolder of your windows install directory.
 
Joined
Jul 8, 2002
Messages
14,681
A search for hosts will return several results.
You need the 1 in C:\Windows with no extension. Its file type will be "File", make sure it isnt hosts.sam you have.
When you open it, it wont just open in Notepad, you will get a list of programs to open it with, choose Notepad and click open.

At the end of the hosts file add this line

0.0.0.0 website.com

replacing website.com with the site you want to block.
That will quickly return a 404 error. To make it look like its trying to access the page, then fail, use this line.

127.0.0.1 website.com
 

Baktash

Thread Starter
Joined
Jan 9, 2003
Messages
77
Oh its working perfect.I can't find the words to thank you. Thanks Thanks Thanks. You guys are so expert. Thanks alot.
 
Joined
Jul 8, 2002
Messages
14,681
[tsg=yourewelcome][/tsg]

FYI-if someone tries to go to the site, they can get there by removing it from the hosts file, or by typing the IP address in directly.
 
Joined
Feb 8, 2003
Messages
1
mmm host ahhh i think not as aol and any other preinstalled provider software only support it and on finishing my ccnp and mct its a new 1 on me
 
Joined
Sep 3, 2003
Messages
13
I need help blocking a website.....I tryed searching for hosts but all i find is the hosts.sam
someone please help!!
 

Bryan

Bryan
Joined
Jul 3, 1999
Messages
11,943
Or just copy Hosts.sam and name it Hosts with no extension. Then add the IP addresses as noted in previous postings.

Or just rename Hosts.sam to just Hosts and then edit it with Notepad. You don't need a Hosts.sam file, it's just a sample template.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top