Block Websites of your choice without any Software

I came across a fellow blogger today who wanted to know if there is any way to block a website without using Softwares. I was pretty amused to hear this and thought of putting it up as a blog for all the readers who are not aware of this age old trick.

 Lets assume that you want to block www.abc.com and www.def.com. In order to achieve this: 

  • Open the folder C:\WINDOWS\system32\drivers\etc.
  • Look for the file called HOSTS.
  • Open the file HOSTS in your favorite Text Editor ( mine is Textpad)
  • Under the line “127.0.0.1 localhost” add another line as “127.0.0.2 www.abc.com “.
  • Both the sites are now blocked. In case if you want to add more in your blocked websites list, just edit the list and add more.

So now you know what you gotta be doing with those annoying banner sites ;)

Do share your views in comments.

You can follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Related posts:

  1. Microsoft Windows: More fun with the HOSTS file
  2. From the Archives
  3. How does Email Scanning Work?
  4. Access Blocked Websites: The simple way :)
  5. [How-To] Block Visitors From Certain Countries To Your Website

25 Responses to “Block Websites of your choice without any Software”

  1. Amazing…..how do you get all tis info dude? :)

  2. hi
    i m very to read ur suggestion but can u tell in which extension should i save the file and can u tel me any software to hear the conversations of other person’ mobile on mine one………….???????plzzzzzzzzzzzz

  3. Hi Rahul,
    Thanks for reading the post.
    The HOSTS file is already present, you dont need to create a new one. All you need to do is EDIT the already existing file.
    Thanks
    Vaibhav

  4. i dont have that 127.0.0.2 in my hosts file is something wit 192….

  5. hi sreyaasd
    127.0.0.2 is not available in Hosts file by default. In case if you wish to block some website then only you should add that entry in the file. In short, you need to edit the file to add that entry. Its not available by default.
    cheers,
    Vaibhav

  6. [...] Previously, I had written about HOSTS file in my post  Block Websites of your choice without any Software. [...]

  7. how to work it i done it but still i can view the site i want to block the site

  8. did u try restarting the pc?

  9. yes but still i restart the computer how to it plzzzzzzzzzzzzz and yes i i’m running internet cafe i control everything from server

  10. Hi Sailay
    For this i would suggest you install some software which blocks the traffic. I am not sure if you control everything from the server using Hosts file trick.
    Cheers,
    Vaibhav

  11. i try it to block youtube but don’t work at all is there anytrick to it plzzzz help me my friend
    thank you

  12. Hi Nader,
    Websites like Youtube which are registered on multiple dynamic IP’s as well cant be blocked using this HOSTS file trick. I suggest you get some website blocker software for this.

    -Vaibhav

  13. For those of you wishing to block Youtube or other websites from your cyber cafe’s, i would suggest you go through this free tool at
    http://www.k9webprotection.com/

    Cheers,
    Vaibhav

  14. the language bar on my computer is last how should i found i tried but i didn’t find it i tried regional language setting but didn’t work help me

  15. [...] Block Sify Group Site Pages on Login While using Sify BB, its group site pages keep opening on their own using precious RAM memory and annoying you. For how to block these websites: Lets assume that you want to block Home – ABC.com and Def.com – MP3 Resources and Information. This website is for sale!. In order to achieve this: § Open the folder C:WINDOWSsystem32driversetc. § Look for the file HOSTS. § Open the file HOSTS in your favorite Text Editor ( mine is Textpad) § Under the line “127.0.0.1 localhost” add another line as “127.0.0.2 Home – ABC.com “ § Similarly to block Def.com – MP3 Resources and Information. This website is for sale! add another line as “127.0.0.3 Def.com – MP3 Resources and Information. This website is for sale! “. § Both the sites are now blocked. In case if you want to add more in your blocked websites list, just edit the list and add more. So now you know what you gotta be doing with those annoying banner sites The above is extracted from: http://technofriends.in/2007/08/19/block-websites-of-your-choice-without-any-software/ [...]

  16. Block Websites of your choice without any Software

    Dated August 17, 2007

    Dear Vaibhav Pandey:

    How does one block websites of Sify Broadband’s Group sites opening on their own. Your method is not effective in this case. Pl do guide

  17. Hi,
    I have blocked the site using the above procedure. If i need to block internet access only in particular time?? how can i do that. ?
    Kindly.. mail me.. regarding this.

    Regards,

  18. Thank you for the valuable information, keep going, thanks once again.

  19. Itz not working..!!! :(

  20. Hi Piyuu
    Please refresh your DNS cache either by restarting your PC or by using a DSN Flush command. The browsers usually cache the DNS entry and therefore it takes quite sometime for the HOST File changes to reflect. Especially with Firefox this takes much longer.
    Thanks
    Vaibhav

  21. i cant find the host file

  22. [...] If you are a developer who often has to test same application deployed on different servers, the various options you have are 1.) Modify your HOSTS file to point to a new IP. You can learn more about modifying HOSTS file by reading previous posts on HOSTS file ( Microsoft Windows: More fun with the HOSTS file and Block Websites of your choice without any Software) [...]

  23. ehm.. i´m from ecuador and i have a company. so what i want to do is that my secretary just can usee internet for one page. the company page.but ive been looking for softwares and i tried to do what you said in your blog. but it didint worke. there´s a note that daiid that i cant save the changes. so i cant block those pages. i really want to know how to block and to permite just one page.
    please help me!

  24. [...] Previously, I had written about HOSTS file in my post  Block Websites of your choice without any Software. [...]

  25. You must remember when blocking sites to add a line for the address with the www as well as without it. Many sites also have a back door that you need to block too. Like facebook for example. If you have facebook blocked in the hosts file you can still get it by typing facebooklogin.com. I’ve found blocking messenger sites is useless. There is a new site every day and teenagers seem to know how to find them quicker than I can add them.

    I’ve made an instructional video on how to block sites with the hosts. It can be found here.

    http://helpviavideo.com/watch.php?vidid=37

Leave a Reply