Improve productivity. Block websites.

Saturday, 21 December 2013

⚠️ This is an old post

It's possibly been exported and imported from at least three different blogging platforms over the years. That probably means, at best, there are broken images and links. If the post is technical in nature, any advice is probably out of date and irrelevant. Or it is really old, it was the wafflings of a teenager with too much time on his hands working out what blogging is… If it is the latter I would probably cringe if I re-read it. But it's here because it's part of my past, not my present.

You've been warned! Onwards…

Recently I’ve taken the sweeping step of preventing my computer from accessing specific websites. These site I have determined to be time-suckers, ones that I can simply live without. I don’t need to habitually check in on Facebook or on Instagram from my laptop, especially when I really should be working!

To do this I’ve done a quick hack to the hosts file. It is kind of like an internet address book for computers - it matching a web address with an IP address. Obviously it doesn’t contain a list of every web address, that’s where your Internet Service Provider (ISP) comes in, however the hosts file is where your computer looks first. If the address is found, then it doesn’t need to consult the ISP. So to block websites from my computer I’ve given the hosts file the wrong address!

For example, one time-sucking website is Facebook. I don’t need access to it from my laptop so I’ve told my host file that the IP address is, the address of my own computer, and magically the computer cannot find site.

Every operating system has a hosts file, and Wikipedia has a list of where it is on your hard drive. Open up the file in your preferred text editor (Notepad or TextEdit will work) and you’ll see a file like this: localhost broadcasthost
::1 localhost
fe80::1%lo0 localhost

At the end of this file add: []

Save the file, reboot your machine and try to access the website.

Hello productivity.

Back to all posts