How To Block Facebook Using Hosts File

Facebook is the most visited social networking site in the world with more than 400 Millions of users. Based on some research, people log on to Facebook 4 times a day and spend at least 7 hours checking with friends news updates including checking pages with large number of Facebook likes, etc. Some fears Facebook will reduce human productivity and may lead to addictive behavior. If you are searching for the most simple ways to block Facebook, this post will absolutely helps you.

In this post, I will show you simple and quickest ways to block Facebook by using Hosts file. Enjoy!

Simple Steps to Block Facebook

1. Go to Start > Run or press Windows + R

How To Block Facebook Using Hosts File - Step 1

2. Copy these string into Run fields.

How To Block Facebook Using Hosts File - Step 2

Please copy the string based on your Operating System. You can refer below:

Windows XP, Vista and Windows 7

Windows 2000

Windows 98/ME

3. Click Enter and then open the hosts file using your preferred text editor. I used Notepad.

How To Block Facebook Using Hosts File - Step 3

4. Copy and Paste the following into the Hosts file after localhost

# Block Facebook

How To Block Facebook Using Hosts File - Step 4

5. Save your Hosts file and your are done! You can try to open Facebook and if there is still no effect, restart your workstation and retry again.

Please make a backup of your hosts file in case of anything happened

47 thoughts on “How To Block Facebook Using Hosts File

  1. Pingback: How To Stop Yourself From Facebook-Stalking Your Ex

  2. Pingback: Just One Night Love » Blog Archive » How To Stop Yourself From Facebook-Stalking Your Ex

      1. Guest

        ckemi jam tahir doda djali i hakik dodes jeton perkohsisht ne tirane po te shpise i kam ne peshkopi …. jam krenar me prinderit e mi por me shum me mamin si e kam si shpirt e puth nga ktu ku jam dhe i them se e dua fort ,………………. te dua mami ……..

  3. Pingback: The World Is Obsessed With Facebook - Page 2 - Stormfront

  4. fahd4007

    those r good url 4 blocking facebook


  5. Pingback: How many times a day do you check your email? - Page 3 - The Wholesale Forums

  6. Pingback: 7 Tips for a Healthy Break-Up | My Journey To Self- Actualization

  7. jorge wiggum

    Great advice, nice method. Only thing to nitpick is, get rid of the line numbers in the listing of IP mappings you tell folks to cut and paste. The line numbers, you don’t want in there. Had to manually edit them out.
    And btw, you have UNIX to thank for “the hosts file” .. which in the unix structure resides at /etc/hosts
    .. UNIX, developed by Ma Bell and DARPA (YOUR tax money).. the modern version of which is LINUX ( … anyone paying money for a Window$ license is nuts! ESPECIALLY bloated government idiots!

  8. Paul

    On top of this you can also move the location of the hosts file. Change this registry key to the location of your choice and move all contents of the “etc” directory to that location.


  9. sweety

    i hate to block fb but if i see how to block it i can know how to unblock it now i know how to unblock it i am so happy

  10. Sam

    I did all the steps but when i want to save, it says i can not save it because im not the administrator although i was able to work in the administrator account, so can you solve this for me please, thanks

  11. Pingback: I wish I could draw | A (usually) visual blog to share my work and things that other artists create.

  12. LarryX

    How can this url system be blocked also?

    facebook get registered this and more http://www.www.www names…

    last name cheked:

    if you add one www. to this adress – it not work….

    al other combination like:
    and. ….. blaq bla bla ………

    just be added manually in your host file…
    but FACEBOOK have a https:// access also
    and some other way to access….

    you cand find and add it manually…

    good luck…

  13. fyidudes

    if you use instead of windows will simply drop the packet instead of trying to resolve it. This will prevent any delays or timeouts, and will instead simply not render the page pretty much instantaneously. is an invalid address so windows just drops it.

  14. Pingback: Anonymous

  15. vesti srbija

    I really love your site.. Pleasant colors & theme. Did you develop this
    website yourself? Please reply back as I’m wanting to create my own website and would love to find out where you got this from or what the theme is named. Kudos!

  16. aacs

    Thx so much for this!I have tried multiple softwares in an attemp to block Facebook to my children but non of them did the trick. This is all i needed. Simple

  17. Rebecca

    Can I use these steps to block a person’s name from appearing on my facebook search box? I don’t want to add them to my block list but I don’t want them to pop up in a search. We are not friends. I also don’t want to completely block facebook.

  18. Vinamra Koshy

    Hello there! Do you know if they make any plugins to safeguard against hackers?

    I’m kinda paranoid about losing everything I’ve worked hard on.
    Any recommendations?

  19. Pingback: InfoSec Institute Resources – Raising a Rogue Access Point

  20. eimear

    our company uses the hosts file to block facebook. unfortunately, this means that the facebook like button on our website doesnt work either and just shows a large grey box on the page. because of this, we are concerned that other companies using the same method to block facebook will also be unable to see it and will just see the distorted version of our page. is there a work around that we can use so that our facebook like button can be displayed without allowing facebook in the hosts file?

  21. Pingback: Raising a Rogue Access Point

  22. Pingback: Redirect Facebook with HOSTS file | matt();

Leave a Reply

Your email address will not be published. Required fields are marked *