Home » General, Security, Tutorials

How to: Block a website

24 April 2008 19 Comments



Want to bully your friends by blocking their favorite websites or just want to hide some web pages from your children? Here’s how you can block certain websites on your home computer:

Step 1: Click the Start button and select Run. Type the following text in that Run box:

notepad c:\WINDOWS\system32\drivers\etc\hosts

Step 2: You will see a new notepad window on your screen containing some cryptic information. Don’t panic. Just go to the last line of the file, hit the enter key and type the following (for example):

127.0.0.1 myspace.com

Save the file and exit. That’s it. None of the above sites will now open on your computer.

You can block as many websites as you like with the above technique. If you want to remove the ban later, open the same file as mentioned in Step 1 and delete the above lines.

More Cool Windows XP Tips & Tricks HERE!

19 Comments »

  • Akshay said:

    Thanks a ton boss… cool trick

  • Eerik said:

    You’re welcome :D

  • Jason said:

    Trying to block a web site and your trick is not working?

  • satish said:

    nice trick boss thanks

  • Dipu said:

    using this tip we cant block http://www.bharathmatrimony.com.please help

  • Linda said:

    I am trying to block http://www.urbandictionary.com from my teenager and I have tried several times and it will still open with no problems. Any idea?

  • Pawan said:

    this help is not working. any other idea, please provide. I am very thankful to you, if you can provice. How can I block yahoo messenger?

  • Foyzul Karim said:

    please try to reboot the computer after changing the host file in the appropriate folder

  • Anthony said:

    it did not work and I am 100% sure my computer is xp

  • Sfttyjyz said:

    ryan adams tattoo,

  • Prasad said:

    Hey dude thanks for that ,I.E. CAN’T OPEN SUCH KIND OF SITE BUT GOOGLE DO THIS ,PLZ HELP ME

  • Umer said:

    it doesnt work buddy!

  • rahul said:

    Want to bully your friends by blocking their favorite websites

  • rahul said:

    how to lock site windows xp

  • netram soral said:

    sir,mein facebook ko block kiya tha kekin fir bhi facebook khul jati hai.notepad c:\WINDOWS\system32\drivers\etc\hosts
    asha kho ……..
    plz answer me…………!

  • John said:

    it doesn’t work for me.

  • vishal said:

    it didnt work at all…
    its fake

  • bleh said:

    Your browser caches the hosts file when it starts up. So if you hit the site and see it works, then do the hosts file trick mentioned in this page and just hit the site again in your browser it will still work. You have to close all your browser windows and restart the browser to get it to take effect.

    Your computer will look to the hosts file to resolve a hostname before it asks the DNS server so this is a simple way to block the unwanted websites. The downside is that its easy for someone to take it out of the hosts file if they have local administrator rights on the computer. But I guess a lot of users aren’t geeky enough to know or guess that would be the problem. :)

    Its not a fake. But this wont work if you use a proxy, because the proxy does the DNS lookup for you. If you use a proxy then you have to put the hosts file entry on the proxy itself and then usually you would need to restart the proxy service for it to take effect.

    happy geeking..

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.