How do I ban an ip addresss from my computer?

Mark

Golden Member
Oct 9, 1999
1,486
3
76
Like if I wanted to ban yahoo.com from being acsessed on my comp. Someone told me all I would have to do is get the yahoo.com ip address and enter that into the hosts file in the Windows directory? Alot of people have told me this but no one was clear on the instructions. Does anyone know how to do this?
 

Pretender

Banned
Mar 14, 2000
7,192
0
0
You can't completely ban an ip address from being accessed from your computer without using a firewall or net-blocking (netnanny type crap) software. You can, however, modify the hosts file and associate domain names with a certain ip.

Por ejemplo (for example):
to 'block' forums.anandtech.com, add the following line in the 'C:\<win directory>\hosts' file:

127.0.0.1 forums.anandtech.com

Whenever you try to connect to forums.anandtech.com, it'll think it's ip is 127.0.0.1 (your own computer) and assuming you're not running a web server on your computer, you'll get a 'cannot find server' error.


Summarized: To ban a website from your computer, add the following to your \windows\hosts file: 127.0.0.1 xxx.myhost.com, where xxx.myhost.com is the server you want to block.
Note: Browser will need to be restarted for this to take effect

 

perry

Diamond Member
Apr 7, 2000
4,018
1
0
Open up a command prompt, go to c:\windows (or wherever windows is installed). &quot;copy hosts.sam hosts&quot; &quot;edit hosts&quot;

You'll see:
127.0.0.1 localhost
at the bottom of the file. You'll add:
127.0.0.1 www.yahoo.com
That'll make your computer think that www.yahoo.com goes to your computer instead of across the internet.

I think that's what you were talking about...
 

Rogue

Banned
Jan 28, 2000
5,774
0
0
You could also add a route statement that points the IP address you are wishing to block to 127.0.0.1 also. Most people are less likely to look at their routing tables, especially if they're not computer savvy.