IP Blocking on Windows

Is there any WIN32 API's to block IP address/s without using any firewall?

Reply to
sunil.k.mishra
Loading thread data ...

You can use the Hosts file to block IP addresses.

formatting link

Reply to
shoe gazer

No, you can't. The HOSTS file ONLY translates EXACT matches of host/domain names to IP addresses of your choice. You can't enter an IP address and translate, or redirect, it to another IP address. You can block host/domain names by redirecting them to the localhost IP address of 127.0.0.1.

Reply to
dak

snipped-for-privacy@gmail.com wrote in news:1116509960.605904.286700 @z14g2000cwz.googlegroups.com:

I really don't know what you're after as far as some Win32 API that can be used to block IP(s). There is a packet filtering solution on the Win 2k O/S and up.

formatting link
Duane :)

Reply to
Duane Arnold

Viking proxy server may be of use.

Reply to
atec

it's a simple text file called hosts (no extension). Configuration looks like this

formatting link
127.0.0.1 single line for each site you want to block. An easier way is to use Spybot Search & Destroy and install it's host file locking, part of the immunize system setup. Combined with tea-timer it works quite well in preventing unauthroized changes to both the registry by using an alert popup.

Reply to
test

You need 3rd party software to do such things. Such as software (or hardware) firewalls.

Reply to
Tom - www.safercomputing.com

Again, the HOSTS file does *NOT* block IP addresses, it (re)directs domain/host names to IP addresses that you have entered, which can be used for blocking. You can *NOT* redirect one IP address to another.

Wrong. That's backwards. The proper configuration is one entry per line with the IP address first followed by at least one blank space and then the domain/host name you want to be redirected. Like this:

127.0.0.1
formatting link
127.0.0.1 example.net

Reply to
dak

Please note that I was only straightening out incorrect information about the HOSTS file. :o)

When I don't want to connect with something I either drop the domain name or host name in DNSKong's named.txt file, or the IP address or address range in eDexter's PAC file. I don't use the HOSTS file for blocking, too much effort compared to DNSKong & eDexter.

Noted. And if the person does not have a router?

Reply to
dak

if you want to stop your windows having an IP 'conversation' with another node then you could set up 'route' so the replies get lost

eg, if your windows is on 192.168.1.5 with a mask of 255.255.255.0 and your router is in 192.168.1.1 and you want to not talk to

216.73.92.112
formatting link

do route add 216.73.92.112 mask 255.255.255.255 192.168.1.2 /p

Note. there is no router (or anything) 192.168.1.2.

Reply to
postmaster

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.