The hosts file is used to map hostnames to IP addresses. However, I only have an IP address. I tried using HostsMan, but it doesn't want to even add the line.
How do I add a line to the hosts file if I only have an IP address?
The hosts file is one of several methods by which the operating system looks up the IP-address corresponding to a hostname.
The "hostman" editor is an editor for this file.
The hosts file is a text file and can be edited using any text editor, for example notepad. You just have to be careful to conform to the format rules for hosts files.
The hosts file can't be used to forbid access to an IP-address but it can be used to give the operating system a false IP-address for a hostname you want to block. For example if you add the line
You will then no longer be able to access this website.
You can use a blackhole route to prevent any packet destined to a certain IP/block of IPs to even getting to a router by
You should choose a destination IP from your local network if you are behind NAT. If you are directly connected to the Internet, this will probably not work.
For example, if your IP is 192.168.0.155, you should choose a destination IP of e.g. 192.168.0.166 - anything but your router's address.
Perhaps a better solution is to use firewall. To add a rule is simple, just type
This will work no matter how you are connected to the internet, so it should be preferred. But if you don't have Windows Firewall running, this may not work while the first method does not depend on the firewall.
You can get additional information about Windows Firewall commands on Microsoft Technet Page