26
How to Increase Your Productivity… By Blocking Time-Wasting Websites
0 Comments | Posted by Lars in Productivity
Do you sometimes find yourself fiddling around on the internet for hours on end when you should be doing something more useful with your time? Do you want to kill that temptation so you can actually get stuff done? If so, here is a simple trick that any semi-savvy computer user can do to block “time-waster” sites that suck away hours of your precious time.
Say hello to your ‘hosts’ file
Do you know about your computer’s ‘hosts’ file? Whether you’re a user of Windows, some distro of Linux, or Mac OS X, there should be a ‘hosts’ file tucked away somewhere on your computer. On most Linux and Mac OS X installations, this file is located in the /etc/ directory. On Windows this file is located in the %WINDIR%\system32\drivers\etc\ directory, where %WINDIR% is typically C:\WINDOWS\. [Edit: This is true for Windows XP. I don't know about Windows Vista or Windows 7 but I imagine it's about the same.] Go ahead and check now. Did you find it?
What does the ‘hosts’ file do?
When you type a web address (such as www.becomeawesome.com) into your web browser, your browsers queries a DNS server for the IP address of the website. This is how your browser knows “where” to find the website. (Don’t worry, you don’t need to be an expert on how this stuff works. Just keep reading.) The ‘hosts‘ a file where you can hard-code domain name/IP address combinations. What does this mean to us? It means that if we want to block access to time-waster sites, we can do it on our own computers by simply adding an entry to the ‘hosts‘ file. This will override the normal process and we can point a domain name (such as timewaster.com) to any place we choose. Here is what a typical Mac OS X ‘hosts’ file looks like (which will look about the same in Windows and Linux environments):
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost mycomputer
255.255.255.255 broadcasthost
::1 localhost
If this looks confusing, relax. Let me explain. First, the lines which begin with # are just comments. You can ignore these. In fact, you can ignore everything that is already in here. All we care about is what we’re going to add to it. So, let’s do that.
Adding entries to your ‘hosts’ file to block websites
Before you do anything, make a backup copy of your ‘hosts’ file.
In Windows, simply copy the file and paste into the same directory. This will create a ‘Copy of hosts‘ file. I suggest renaming the file to ‘hosts.old‘.
In Mac OS X or Linux, open a terminal. (If you’re a Linux user, I’ll assume that you already know how to do this =P. For Mac OS X, open Finder, click Applications, open the Utilities folder, and double-click the Terminal app.) Then type the following command:
sudo cp /etc/hosts /etc/hosts.old
You will probably be prompted for your password.
Now, on to the blocking!
To block a website, simply append a couple lines of text to this file that look something like this:
127.0.0.1 timewaster.com
127.0.0.1 www.timewaster.com
If this is Windows, again, you can use Notepad. If this is Mac OS X or Linux, I recommend using vi or pico, unless you already have a favorite editor. If you don’t know how to use either one, do a web search for ‘vi tutorial‘ or ‘pico tutorial‘. There are plenty of good tutorials out there. I don’t need to write another.
Now, you might be wondering:
- What is 127.0.0.1?
- Why did you enter timewaster.com AND www.timewaster.com?
Let me explain.
- 127.0.0.1 is the IP address of your computer’s loopback interface. In plain English, it’s your computer’s way of saying “this is me”.
- In some situations, timewaster.com and www.timewaster.com might point to different addresses. I won’t go into to too much detail. Take my word for it: we want to block both.
When we add an the entry ‘127.0.0.1 www.timewaster.com‘, we are basically saying, “Redirect anything that wants to access www.timewaster.com and point it to my computer.” Your computer obviously doesn’t host the website, so when you do this you will no longer be able to access the site. Score!
To edit the file, simply open it the ‘hosts‘ file with Notepad. Add all of the sites you wish to block and save the file.
Verify that the site(s) is/are blocked
Now try to go to the sites that you just blocked. If you did everything properly, you will now no longer be able to access that site (and you will be much more productive). If at any point you wish to unblock a site, simply remove the appropriate entries from the ‘hosts‘ file.
Sites you should block
Here are some suggestions for the types sites of time-waster sites which you could block:
- Social networking sites
- News sites (I personally think that most of them are garbage)
- Web forums (at least those not related to your work or education)
- Video/TV show streaming
- Chat rooms
- Any other sites which you spend significant amounts of time on which provide little or no value to your life
Later, you’ll either thank me or curse my name. Either way you’ll be more productive.

