How To Block Facebook / Any Website Without Using Software

If you want to block / restrict a particular website or multiple websites on your computer just follow the below steps. This trick will is useful to block any websites which are surfing by your children or anyone in your house or company computers.
You can also block the software from validating the product key or license information form the software website.

Now Let us see how to block a website. Example: www.facebook.com

Read: 2 Ways To Rename Multiple Files And Folders In Windows

How To Block Websites Without Any Software

  • Open My Computer and go to C:\Windows\System32\drivers\etc
    Find Hosts file
  • Open hosts file in notepad  (Double Click To Open)
  • Select Notepad in Open with Dialog.
Open Hosts file in notepad
  • Text in the hosts file look like in below image.
Hosts file
  • Below the  127.0.0.1              localhost 
  •                   ::1                        localhost
  •  Enter websites in below format
  •  127.0.0.1        www.SiteName.com
  • To block facebook website add the below line to hosts file
  •   127.0.0.1      www.facebook.com   
Add facebook.com to hosts file
  • To block multiple websites Add website one after one in a new line in the below format
  • 127.0.0.1     www.SiteName.com
  • See the below image.
Add multiple sites to hosts file
  •  Ctrl+s and save the hosts file. 
  • That's it open any browser try to open the website which you blocked. It will show the Unable to connect message.
Unable to connect mozilla firefox
  • This works on all the browsers like Internet explorer, Firefox, Chrome, Opera, Safari,....etc

How To Unblock Website

  • Simply Remove the line which you have added in hosts file.
Read: How To Disable Startup Programs

    29 Comments

    1. In my system localhost is not there then how can I setup

      ReplyDelete
      Replies
      1. just add website name to hosts file as i mentioned in the post. it will work.

        Delete
      2. bhai ye work nhi kar raha h

        Delete
    2. Thanks! Works pefectly. I am also a computer professinal, looking for this to stop me from accessing FB on PC & limit me to access only on Mobile to save my time. I have used my Xps viewer to take print of this page for future use only. Thanks again.

      ReplyDelete
    3. WOW.. this is just great and very informative but I also want to tell everyone if Facebook is blocked then they can access blocked website by using this link.

      Unblock Facebook

      ReplyDelete
    4. If the kids are smart you can remove the www. as most sites allow you to access it without the www

      ReplyDelete
    5. You can also access any blocked site if you want. For that you just need to click on this link if you are willing to open any blocked site.
      Unblock all Sites

      ReplyDelete
    6. good share...............the method describe here also works perfectly for me-http://www.superpctips.net/2012/05/how-to-block-website-in-windows-7.html

      ReplyDelete
    7. Superb ! Your blog is incredible. I am delighted with it. Thanks for sharing with me.

      ReplyDelete
    8. good one what if it says access is denied to host folder

      ReplyDelete
    9. i am not able to make the save of the edidted file please any suggestion.

      ReplyDelete
    10. its not working...actually the file ccant b save in the name of host....so wt shld i do....

      ReplyDelete
    11. you may copy paste the file on dekstop. then make the change. then save it on desktop. then cut it and paste and replace the original host file with this new one. it should work this way.

      ReplyDelete
    12. This is all well and good, until Facebook redirects the request to SSL and then it's not blocked AND encrypted!

      ReplyDelete
    13. it block in all place or just my computer

      ReplyDelete
    14. not working if https:// is used

      ReplyDelete
    15. This comment has been removed by a blog administrator.

      ReplyDelete
    16. when i try to save..
      it says ..that i dont have the permission to do so..and asks if i want to save in another folder

      ReplyDelete
    17. hasn't worked for me either, i wasnt able to save so i did as anonymous suggested - (you may copy paste the file on dekstop. then make the change. then save it on desktop. then cut it and paste and replace the original host file with this new one. it should work this way.)

      however, even though the file has successfully changed and has the line of text with facebook on it, i can still access the website as normal. any ideas?

      ReplyDelete
    18. hey, this is the above commenter, i spoke too soon. has worked fine! thanks (unfortunately i cant delete the above comment)

      ReplyDelete
    19. Since it was opened as a text file, it wants to save as a text file. Then it won't let me access the folder.

      ReplyDelete
    20. Awesome.... jus incredible bro.... ur trick has jus solved my huge obstacle... hats off dude.... kep goin.. ;)

      ReplyDelete
    21. Bro i got a prblm to save the file. its asking that ask permission to administrator

      ReplyDelete
    22. my window defender deleted it omg

      ReplyDelete
    23. in my system local hosts is not there please help me

      ReplyDelete
    24. Sorry Boss it is not working .i don't know where is the problem .

      ReplyDelete
    Previous Post Next Post