Say I want to block "xxx-xxxx-xxx-xxxx" and that alone from being accessible from any web browser on the system.

Is there any way to do that plainly and simply without having a need for bulk programs?

Or to one-by-one block certain websites I want by IP address?

I heard a while back that it's possible to do this by some browser's settings alone, such as in a configuration file, or on OSes with TCP/IP configuration to block packets sent to certain IP addresses (so that it disallows communication to that address and all browsers on the system will fail to connect/retrieve info, thus like blocking).

I know something like this must be possible, because I read a few years back and accomplished this on Windows 7 Home Edition. A file was edited, and no browser could send packets to specified IP addresses.


My OSes: Ubuntu 12 / Windows 7 / Android 2.3.4.

Router: Belkin Wireless N300 Router.

NOTE: I accomplished this without changing any settings with the router.

  • It might help if you said which operating system and which router you have. – DavidPostill Sep 29 '14 at 21:36
  • Updated to reflect on that now. – user373557 Sep 29 '14 at 21:39
  • 1
    You asked how to block connections by IP address, but evidently that is not what you meant, since you accepted the answer below, which does not pertain. Please edit your question accordingly. – kreemoweet Sep 29 '14 at 23:39

Try editing the hosts file: Open a command prompt with administrator rights, then type:

attrib -r \windows\system32\drivers\etc\hosts
notepad \windows\system32\drivers\etc\hosts

Add a line like this one: www.example.com

After closing, no browser on the system will be able to reach www.example.com.

For Linux, edit the same file. In terminal, use this command:

sudoedit /etc/hosts

For OSX, use a similar command:

sudo edit /private/etc/hosts

Make sure that no web server is running on the local machine, otherwise you will always get its hosted default website when calling the domain that you blocked with this method.

|improve this answer|||||
  • I added a comment about a possible local webserver. – mynetx Sep 29 '14 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy