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

About Author
Juan Harris is a Web Designer, Photographer and Blogger at He love to daydreaming while drinking fruit juice.

The Tags: , , , , ,
Incoming Search: block facebook hosts, block facebook hosts file, how to block facebook, how to block facebook using host file, block facebook host file, block facebook using host file, facebook hosts, block facebook host, host facebook, hosts facebook, facebook hosts file, block facebook with hosts file, hosts file block facebook, how to block facebook in host file, how to block facebook with host file, block facebook using hosts file, host block facebook, hosts block facebook, host file block facebook, block facebook in host file
  • Pingback: How To Stop Yourself From Facebook-Stalking Your Ex

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

  • Jeff Schult

    OK — so to make this complete, what you really need is a “Like” button for Facebook on the bottom of the post.

    L.o.l …

    • Cari

      LOL.. definitely Jeff..

      • 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 ……..

  • rajbir

    How To unBlock Facebook Using Hosts File. if using Trend Micro Worry-Free Business Security.

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

  • Hugo

    will this block the https://facebulls**

    how to block those ?

  • ArtGoddess

    I’m wondering if this method also blocks Facebook when requesting from this url:

    Seems FB has configured subdomains that way in order to avoid be blocking by hosts file.

    How can this url system be blocked also?

    Thank you!

  • poo

    Cannot block!!! WHY?

  • fahd4007

    those r good url 4 blocking facebook


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

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

  • 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!

  • 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.


  • 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

  • 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

    • Cari

      Maybe you should run the program as an administrator 1st

  • Hemal


  • BrainDumps

    such a long process it is

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

  • Arya

    Dude,You should enter the ip address also

  • 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…

  • 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.

  • Pingback: Anonymous

  • Anonymous

    Can someone tell me how to block the

  • Nam Plus

    Thanks, but not work for this way.

  • 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!

  • 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

  • jewby

    @aacs : that won’t work for long, they will use proxy sites or so.

  • 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.

  •;u=16126 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?

  • jayesh

    thnx a lot. . .

  • Pingback: InfoSec Institute Resources – Raising a Rogue Access Point

  • K

    How to stop other person to change host file?
    Other person chage host file and can access facebook?
    Any Password facillity to stop

  • Bichitra

    I need to blook

  • whatthebleep

    Fb is fascist.

  • unix

    i am getting a problem while saving the host file…it says cannot create dat path..wat shoud i do?

    • Juan Harris

      You will need a administrator right to save a host file.

    • Carl Harris

      You need administrator access to save host file.

  • CB

    can I set a time limit on facebook using notepad?

    • Juan Harris

      I believe that you will need additional application to set limit on usage.

    • Carl Harris

      You’ll need a third party application to do so.

  • 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?

  • Pingback: Raising a Rogue Access Point

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

  • Gurpreet

    nothing happens even after you save the file