Block facebook dengan host shield file editor

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

2. Copy these string into Run fields.

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

Windows XP, Vista, Windows 7, Windows 10 and  above
C:\WINDOWS\system32\drivers\etc\hosts

Windows 2000 
C:\WINNT\system32\drivers\etc\hosts

Windows 98/ME
C:\WINDOWS\hosts
Block facebook dengan host shield file editor

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

Block facebook dengan host shield file editor

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

# Block Facebook
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 static.ak.fbcdn.net
127.0.0.1 www.static.ak.fbcdn.net
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.connect.facebook.com
127.0.0.1 www.static.ak.connect.facebook.com
Block facebook dengan host shield file editor

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.

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


Cover image credit to telegraph.co.uk

Download Article

Download Article

  • On Windows
  • |
  • On Mac
  • |
  • On iPhone
  • |
  • On Android

This wikiHow teaches you how to prevent a specific website from being accessed on any browser on a Windows or Mac computer by editing the "hosts" file. Additionally, you can block sites on an iPhone or iPad using the Restrictions menu in the Settings, and Android users can use the free BlockSite app to restrict website and app access.

  1. Block facebook dengan host shield file editor

    1

    Open the Start menu

    Block facebook dengan host shield file editor

    . Click the Windows logo in the bottom-left corner of the screen or press the Win key.

    • On Windows 8, you must hover your cursor in the top-right corner of the screen and then click the magnifying glass icon.

  2. Block facebook dengan host shield file editor

    2

    Type Notepad into Start. Doing so will display the Notepad app at the top of the Start menu window.

    Advertisement

  3. Block facebook dengan host shield file editor

    3

    Right-click on Notepad and select Run as administrator. This option will open Notepad using your administrator privileges. If you don't open Notepad in administrator mode, you won't be able to edit the "hosts" file.

    • On a laptop with a trackpad instead of a traditional mouse, use two fingers to tap the trackpad instead of right-clicking.

  4. Block facebook dengan host shield file editor

    4

    Click Yes when prompted. Doing so will confirm your decision and open Notepad.

  5. Block facebook dengan host shield file editor

    5

    Click File, then click Open…. You'll find Open in the File drop-down menu.

  6. Block facebook dengan host shield file editor

    6

    Go to the Hosts file's folder. In the window that opens after clicking Open..., do the following:

    • Click the This PC tab on the left side of the window.
    • Double-click your computer's hard drive (e.g., OS (C:)).
    • Double-click the Windows folder.
    • Scroll down and double-click the System32 folder.
    • Scroll down and double-click the drivers folder.
    • Double-click the etc folder.

  7. Block facebook dengan host shield file editor

    7

    Show all file types. Click the "Text Documents" drop-down box near the bottom of the window, then click All Files in the drop-down menu. You should see several files appear in the window.

  8. Block facebook dengan host shield file editor

    8

    Allow editing for the "hosts" file. Right-click the "hosts" file, then do the following:

    • Click Properties
    • Click Security
    • Click Edit
    • Check the "Full Control" box.
    • Click OK, then click Yes when prompted.
    • Click OK to exit the Properties window.

  9. Block facebook dengan host shield file editor

    9

    Double-click the "hosts" file. This will open the "hosts" file in Notepad, allowing you to view and edit its contents.

  10. Block facebook dengan host shield file editor

    10

    Scroll down to the bottom of the "hosts" file. You'll see two "localhost" lines of text here.

  11. Block facebook dengan host shield file editor

    11

    Click below the last line of text. It will say either "::1 localhost" or "127.0.0.1 localhost" at the bottom of the page. Your cursor must be directly below the last line of text on this page.

    • Be careful not to delete anything that is already in the hosts file.

  12. Block facebook dengan host shield file editor

    12

    Type in 127.0.0.1 and press Tab . This is the loopback address to your own computer, which is what will return an error page in your web browser when someone tries to visit the blocked site.

  13. Block facebook dengan host shield file editor

    13

    Type the address of the site you want to block. For example, if you wanted to block Google, you would type www.google.com.

    • If you're blocking sites on Google Chrome, you'll need to place a space and then the "www.[site].com" version of the website's address after the "[site].com" version. To block Facebook, for example, you would type in 127.0.0.1 facebook.com www.facebook.com.

  14. Block facebook dengan host shield file editor

    14

    Press Enter. This moves your cursor to a new line. The code you entered will tell your computer to redirect the website to your loopback address instead.

    • You can add as many sites as you want to block, one per line, using the same number (127.0.0.1) as before.
    • If you want to be as thorough as possible, enter different variations of the address (e.g., "google.com" and "https://www.google.com/") as well.

  15. Block facebook dengan host shield file editor

    15

    Save the Hosts file. Your changes won't be saved if you simply save using File > Save, so do the following to confirm your changes:

    • Click File
    • Click Save As...
    • Click Text Documents, then click All Files in the drop-down menu.
    • Click the "hosts" file.
    • Click Save
    • Click Yes when prompted.

  16. Advertisement

  1. Block facebook dengan host shield file editor

    1

    Open Spotlight

    Block facebook dengan host shield file editor

    . Click the magnifying glass icon in the top-right side of your Mac's screen.

  2. Block facebook dengan host shield file editor

    2

    Type terminal into Spotlight. This will prompt Terminal to appear at the top of the search results.

  3. Block facebook dengan host shield file editor

    3

    Double-click the Terminal icon

    Block facebook dengan host shield file editor

    .

  4. Block facebook dengan host shield file editor

    4

    Open the Hosts file. Type the following code into Terminal and press Return:

    sudo nano /etc/hosts

  5. Block facebook dengan host shield file editor

    5

    Enter your Mac's password when prompted. Type in the password that you use to log into your Mac, then press Return.

    • Terminal won't display the password characters as you type them.

  6. Block facebook dengan host shield file editor

    6

    Move the blinking cursor down to the bottom of the page. To do so, press the key until the cursor is below the last line of text on the page.

  7. Block facebook dengan host shield file editor

    7

    Enter the local host address. Type 127.0.0.1 into the blank line. This is the loopback address to your own computer.

  8. Block facebook dengan host shield file editor

    8

    Press Tab . The cursor will move to the right.

    • Don't press Return yet.

  9. Block facebook dengan host shield file editor

    9

    Type the address of the site you want to block. For example, if you wanted to block Google, you would type www.google.com.

    • This line would then read 127.0.0.1 www.google.com.
    • If you want to be as thorough as possible, enter different variations of the address (e.g., "google.com" and "https://www.google.com/") as well.
    • If you're blocking sites on Google Chrome, you'll need to place a space and then the "www.[site].com" version of the website's address after the "[site].com" version. To block Facebook, for example, you would type in 127.0.0.1 facebook.com www.facebook.com.

  10. Block facebook dengan host shield file editor

    10

    Press Return. This will tell your computer to redirect the website to your loopback address instead.

    • You can add as many sites as you want to block, one per line, using the same number (127.0.0.1) as before.

  11. Block facebook dengan host shield file editor

    11

    Press Control+X. This is the command to exit the hosts file in the text editor. It will prompt you if you'd like to save your changes.

  12. Block facebook dengan host shield file editor

    12

    Press Y to save your changes. It will then ask you what filename you'd like to save it as. You want to overwrite the original hosts file, so don't change the filename.

  13. Block facebook dengan host shield file editor

    13

    Press Return. This will save your changes to the original hosts file. Doing so exits the text editor and returns you to the main Terminal window. The website you added will now be unreachable in any web browser on the computer.

  14. Advertisement

  1. Block facebook dengan host shield file editor

    1

    Open your iPhone's Settings

    Block facebook dengan host shield file editor

    . It's a grey app with gears on it. You'll likely find Settings on the Home Screen.

  2. Block facebook dengan host shield file editor

    2

    Scroll down and tap General. This option is near the bottom of the screen (iPhone) or in the upper-left side of the screen (iPad).

  3. Block facebook dengan host shield file editor

    3

    Scroll down and tap Restrictions. It's near the middle of the General page.

  4. Block facebook dengan host shield file editor

    4

    Enter your restrictions passcode. This is the passcode you used to enable restrictions on your iPhone or iPad.

    • If you haven't yet enabled restrictions, first tap Enable Restrictions, then enter your desired passcode twice.

  5. Block facebook dengan host shield file editor

    5

    Scroll down and tap Websites. It's the last entry beneath the "ALLOWED CONTENT" heading.

  6. Block facebook dengan host shield file editor

    6

    Tap Limit Adult Content. You'll see a blue checkmark appear to the right of this option.

  7. Block facebook dengan host shield file editor

    7

    Tap Add a Website below the "NEVER ALLOW" heading. This is the last option on the page.

  8. Block facebook dengan host shield file editor

    8

    Type in the web address of the website you wish to block. The address must start with "www" and end with a domain tag (e.g., ".com" or ".net"), but you can leave the "https://" section out if applicable.

    • For example, if you wanted to block Facebook on your iPhone or iPad, you would type in www.facebook.com.

  9. Block facebook dengan host shield file editor

    9

    Tap Done. It's the blue button in the bottom-right corner of the keypad. Your selected site is now inaccessible in the Safari browser.

    • This setting also applies to other popular mobile browsers such as Chrome and Firefox.

  10. Advertisement

  1. Block facebook dengan host shield file editor

    1

    Download the BlockSite app. BlockSite is an app which allows you to block websites and apps from being used on your Android. Open the

    Block facebook dengan host shield file editor

    Google Play Store and do the following:

    • Tap the search bar.
    • Type in blocksite and tap the "Search" button.
    • Tap INSTALL below the "BlockSite - Block Distracting Apps and Sites" heading.
    • Tap ACCEPT when prompted.

  2. Block facebook dengan host shield file editor

    2

    Open Block Site. Tap OPEN in the Google Play Store, or tap the shield-shaped Block Site app icon in your Android's App Drawer.

  3. Block facebook dengan host shield file editor

    3

    Tap ENABLE. It's a green button at the bottom of the screen.

  4. Block facebook dengan host shield file editor

    4

    Tap GOT IT when prompted. Doing so should open your Android's Accessibility menu in the Settings app, but if it doesn't, do the following before proceeding:

    • Open Settings
    • Scroll down and tap Accessibility

  5. Block facebook dengan host shield file editor

    5

    Enable Block Site in your Android's Settings. Do the following in the Accessibility menu:

    • Tap BlockSite
    • Tap the grey "BlockSite" switch

      Block facebook dengan host shield file editor

      .

  6. Block facebook dengan host shield file editor

    6

    Re-open Block Site. If Block Site closed or minimized, bring it back up before proceeding.

  7. Block facebook dengan host shield file editor

    7

    Tap . It's in the bottom-right corner of the screen. Doing so will take you to the page from which you can block websites.

  8. Block facebook dengan host shield file editor

    8

    Enter a website's address. Tap the text field at the top of the screen, then type in the address of a website (e.g., facebook.com).

  9. Block facebook dengan host shield file editor

    9

    Tap

    Block facebook dengan host shield file editor

    . It's in the top-right corner of the screen. This will add the website to Block Site's list of blocked sites, which will prevent you from being able to visit the site in Google Chrome.

    • You can unblock this website at any time by tapping the trash icon to the right of its name.

  10. Block facebook dengan host shield file editor

    10

    Block an entire app on your Android. If you have to temporarily block an app, you can do so by tapping in the bottom-right corner of the Block Site screen, tapping APPS, and tapping an app's name.

    • Like websites, you can unblock the app at any time by tapping the trash icon to the right of its name.

  11. Block facebook dengan host shield file editor

    11

    Block adult content on your Android if needed. If you're looking to prevent a child or similar from visiting adult sites or viewing restricted content, check out this article for more adult content-specific instruction.

  12. Advertisement

Add New Question

  • Question

    How can I block a website on the iPad?

    Block facebook dengan host shield file editor

    Parental controls in the Settings app allows you to block websites with a passcode.

  • Question

    How do I force the host file to open in a text editor?

    Block facebook dengan host shield file editor

    It can't be forced to open in a text editor, because it doesn't have the extension. To open, double-click the file and select the proper program to open it.

  • Question

    Can this be reversible?

    Block facebook dengan host shield file editor

    Yes, it is a reversible process. Just remove the extra lines you added. Alternatively, you can restore the hosts file from a backup.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

  • To unblock a site from the "hosts" file, simply open the file again and delete the lines that you added. Make sure you save your changes after removing the lines you added or the sites will still be blocked.

  • Your iPhone's Restrictions settings will apply to both Safari and other browsers as well.

Advertisement

About This Article

Article SummaryX

1. Open Notepad as an administrator.
2. Click File and select Open.
3. Go to C:\Windows\System32\drivers\etc.
4. Show all file types.
5. Allow full permission to the "hosts" file and open it.
6. Type 127.0.0.0.1 at the botom and press Tab.
7. Enter the address to block.
8. Save the file.

Did this summary help you?

Thanks to all authors for creating a page that has been read 1,916,767 times.

Is this article up to date?

How do I block a host file on Facebook?

So, if you want to stop your users from accessing Facebook you can enter Facebook.com into your hosts file and route it to the IP address of your local machine (127.0. 0.1). This will allow you to block websites using hosts file.

How can I bypass blocked by URL filter database?

Different methods described in the other articles:.
Set up your local proxy and configure Your Router For Port Forwarding..
bypass the firewall using Glype + PhProxy plugin for firefox..
Use PHP Proxy..
run your proxy server in virtural machine then put the vitural machine in a DMZ..
use TorPark on a USB drive..

How do I block a website from all browsers?

How to Block Any Website On Browser Level.
Open the browser and go to Tools (alt+x) > Internet Options. Now click the security tab and then click the red Restricted sites icon. ... .
Now in the pop-up, manually type the websites you want to block one-by-one. Click Add after typing the name of each site..