How to block access to certain websites without additional programs?

1

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.

Specs:

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.

user373557

Posted 2014-09-29T21:31:42.360

Reputation:

It might help if you said which operating system and which router you have. – DavidPostill – 2014-09-29T21:36:11.047

Updated to reflect on that now. – None – 2014-09-29T21:39:08.690

1You 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 – 2014-09-29T23:39:06.290

possible duplicate of How do I block certain websites from being accessed through a browser?

– Nifle – 2014-09-30T05:08:40.530

Answers

2

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:

127.0.0.1 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.

mynetx

Posted 2014-09-29T21:31:42.360

Reputation: 291

I added a comment about a possible local webserver. – mynetx – 2014-09-29T21:50:33.067