hendra.dev

A work in progress

Blocking Time Sucking Sites

Written on

This is just one thing that I do, and it involves some editing on a system file, so do it on your own risk. Alright, so one thing that I do to avoid wasting too much time on a just-for-fun site, is to completely block it on my OS. Of course, I can still easily unblock it, but since I am very lazy, most of the time I simply won’t bother doing it.

Ok, the way I do this is by editing the host file on my OS, and point the domain name of the website that I wanted to stop visiting to the localhost, which unless I am running a web server at the time, will simply point to nothing.

On Windows, the hosts file is located at C:\Windows\System32\drivers\etc\hosts. Open up that file, and you should see some description of the file, and an example of the host entry for the localhost, which points to 127.0.0.1. The format for the host file is like this:

<Destination to route to> <Url that you want toroute>

So, for example, in my hosts file, I have this line:

127.0.0.1 www.9gag.com

So, whenever I enter www.9gag.com to my browser, I would get routed to my localhost. Simple enough.

On Linux, the steps are the same, the hosts file is located at /etc/hosts. The format are the same as it is on Windows.

Note that to edit these files, you need to have administrator or root access on the OS.

If you don’t want to edit individual hosts file on every computer you own, an alternative is to use a service such as OpenDNS_. You can register for an account, customize the filtering, and simply configure the internet access on your computer to use the service. That’s all for now.