Possible Duplicate:
block certain websites from browser

I want to be able to open "example" from my computer, but I don't want to be able to open "www.example.com". Is this possible?

  • can you get to iana.org/domains/example ? thats where www.example.com redirects to. – Frank Thomas Dec 5 '12 at 21:27
  • this www.example.com is just example :) ok I want block for example facebook.com. how can make this? – Oto Shavadze Dec 5 '12 at 21:32

You'll want to add it to your "hosts" file to block it:


  • Beat me by 28 seconds. – BillN Dec 5 '12 at 21:38
  • 1
    Haha, yeah I can't believe how three people came up with the same thing that quickly... Edit: 4! Edit: 5!!! – John Dec 5 '12 at 21:39
  • Yeah, looks like a bunch of people had a go at the same time :) – David Dec 5 '12 at 21:42

Add it to your hosts file: facebook.com

This should prevent your browser from doing a DNS lookup on the site, and instead point it at your computer's loopback address. If your computer is running IIS and has a default website, you'll get that, if not you will get an error that the page cannot be found/displayed.


Open C:\Windows\System32\drivers\etc\hosts with Notepad and add the following entries to it: example.com www.example.com

So all traffic to that sites will be redirected to your computer


Open the "hosts" file in C:\Windows\System32\drivers\etc with Notepad (Windows 7). At the bottom of the text on a blank line add " www.example.com" without the quotations and then save the file. When you go to www.example.com it should no longer work. http://www.timeatlas.com/term_to_learn/general/taking_control_with_the_hosts_file

  • Also, some ROUTERs have parental controls features within the web interface. Sometimes you can add websites you want to block within the router configuration. – j_bombay Dec 5 '12 at 21:45

You can add a line to your hosts file. This file is located in:


Open it with notepad and add lines like so:      example.com      Facebook.com

Make sure that you do not rename the hosts file when you are saving it. It is normal for it to have no extension.

  • When I am trying save modified host file, I obtain this popup window: Please check if this file is opened in another program and changes is not saved. I am close all programs (included browsers) but when trying save changes, result again none. – Oto Shavadze Dec 5 '12 at 21:54

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