Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

There's a website,, that I tried to block myself from accessing because it wastes too much of my time. So I configured my /etc/hosts file. I added the following lines, to block the website on both IPv4 and IPv6:

I restarted my computer, and I cannot wget, and pinging works as expected, but the website is not actually blocked in my browser! I can still access it in Firefox 28 and Chromium.


  • What's going on?
  • How do I block this site using systems-level tools instead of using browser extensions?
share|improve this question
In your browser, did you type (which should be blocked) or did you type (which is not blocked)? – John1024 May 4 '14 at 5:51
@John1024 I amended my question to address yours. In the browser, and are blocked, but, and are not blocked. – Newb May 4 '14 at 7:14
@Newb: What Linux distro do you use? – cuonglm May 4 '14 at 8:21
Have a look at hostsblock: it automates this for you and works brilliantly... – jasonwryan May 4 '14 at 8:55

1 Answer 1

up vote 2 down vote accepted

Rather then make this block using /etc/hosts I'd suggest using a browser addon/plugin such as this one named: BlockSite for Firefox or StayFocusd for Chrome.


  ss #1


                    ss #2

But I want to really use /etc/hosts file

If you must do it this way you can try adding your entries like this instead:

You should never add entries to this file other than hostnames. So don't put any entries in there that include prefixes such as http:// etc.

share|improve this answer
The OP does expressly ask for solutions that don't involve browser plugins/extensions... – jasonwryan May 4 '14 at 7:46
@jasonwryan - thanks, missed that last sentence in the Q. – slm May 4 '14 at 7:53
The last part of your answer was correct --- my mistake was that I had written instead of Now the site is blocked. – Newb May 4 '14 at 18:14
This is useful, and both chrome & firefox has an extension named block site, both great. – Eric Wang Oct 14 at 21:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.