Pro Gaming and Tech Geeks is a Blog dedicated for Tech Geeks.

How to Block Facebook Using Host File In Windows

I’ll explain in this post how to block Facebook using host file in Windows.  You may stop your computer from accessing Facebook by adding its domain name to the host file and setting it to your local machine (

In order to help you select the internet management solution that best suits your requirements, I will also discuss the drawbacks of using the host file to impose web access restrictions in comparison to specialized web filtering software.

Block Facebook Using Host File in Windows

Windows is the most widely used operating system. Computers at work are probably running Windows; if so, here’s our advice for blocking Facebook without using any extra apps or plugins. Using this method will stop Facebook from loading.

1. Getting your computer’s “Hosts” file open.

  • It will be required for you to be the profile’s administrator to interact with this file.
  • Launch Notepad in administrator mode.
  • Click the “File” button, then select “Open.”
  • Next, open the Computer and Hard Disc directories to find the “Hosts” document. You will then need to access the following folders: “Windows,” “System32,” “drivers,” and lastly, “etc.”
  • Choose “All files” as opposed to “Text Documents”;
    • Make modifications possible for the “Hosts” document. You must go to the document’s Properties, Security tab, Edit, and then Allow Full Control to do this. After that, you should be able to view the “Hosts” document without any issues.

2. Move the pointer to the line below as you read through the whole contents of the “Hosts” file. To fill the empty bottom line, you might need to hit Enter.

3. Use the Tab key on your keyboard to enter the required IP address,

  • You may then enter all the websites you need to block after that. Put as the website after the IP address.

5. If you want to avoid visiting the website, you may also disable the mobile version of the page. Put a “m.” before the standard Facebook address when writing it.

6. Save the updated “Hosts” file rather than the previous one:

  • Click the “File” button, then select “Save As.” Instead of choosing “Text documents,” select “All files.” Finally, choose the “Hosts” document and save it.

7. Restart the computer. The IP addresses of Facebook pages will be blocked and inaccessible from this computer after loading again.

How to Block Facebook on iPhone and iPad

People frequently use tablets and smartphones to visit social media websites. It is insufficient to only block a certain website on a computer, as nearly everyone has access to the Internet through smartphones and tablets. You must take the following actions on Apple devices to stop someone from using Facebook entirely:

  1. Select “Settings” from the menu on your iPhone or iPad.
  2. To access the general settings, press the “General” button.
  3. From the options, pick the “Restrictions” option.
  4. Enter the password for the current restrictions. There should be four numbers in it. It is necessary to activate Restrictions and generate a new password if you haven’t already established one.
  5. Turn off the “Installing Apps” option by selecting the “Apps” menu.  It will prevent users from downloading apps from the App Store.
  6. Locate the “Websites” option and choose it.
  7. To prevent access to any pornographic content on your device, use the “Limit pornographic content” option.
  8. Look for the “Never allow” settings by scrolling down. Click the “Add a new website” option.
  9. Enter the required website URL that you wish to ban. We want the prohibition of Facebook’s page address in this instance.
  10. Navigate to the home screen after closing the settings. This will remember your modified preferences and stop you from using mobile browsers, such as Google Chrome, Safari, Opera, and others, to access Facebook. You will need to remove the Facebook application if you have it. Special apps created for social networking websites are unaffected by the limited choices.

Make sure your iPhone or iPad is free of any other browsers. The most widely used and trustworthy browsers, including Safari, Google Chrome, and a few others, will respect the restriction settings and block Facebook. 

However, these settings won’t affect shaky or unfamiliar browsers, so you’ll need to remove them. Press and hold the browser icon to accomplish this. Subsequently, click the “X” icon to remove it.

 Facebook Blocking on Macintosh OS X

On Macintosh OS X, there are two methods to block Facebook:

Approach 1: Using Screen Time

  • Navigate to System Preferences.
  • On Screen Time, click.
  • Select Privacy & Content.
  • In order to enable limitations, click Turn On.
  • Choose Limit Adult Websites under Content.
  • Choose “Customise.”
  • Click the + button in the restricted area and type the following domain names:
  • Click,, or

Your Macintosh OS X device will now ban Facebook.

Approach 2: Using the Host File

  • Get the Terminal app open.
  • Enter the following command after typing it:
  • When asked, provide your administrator password.
  • The host file should now have the following lines added to it:
  • To close the editor, use Control+X.
  • Click Y to store the file.
  • To verify the save, press Enter.

Your Macintosh OS X device will now prohibit access to Facebook.

Facebook Blocking on Android Mobile Devices

There are several solutions available on Android devices for blocking undesirable websites. All of them, nevertheless, call for blocking the website addresses with your current browser or with an application of choice. Here are a few techniques you may employ:

Use Firefox to ban Facebook on Android devices

  • If you are using Firefox, you can restrict a certain website using its settings:
  • Go to the browser’s settings after opening it.
  • Choose “Browse for Add-ons” and search for plugins akin to “Block Site”;
  • Add the preferred plugin to your browser’s add-ons.
  • Navigate back to the settings and choose your add-ons. Choose the required plugin and launch it from there.
  • You can enter the website URLs you wish to prohibit in the plugin’s preferences. The plugin that you are using determines all the other functionalities.

Use Google Chrome to ban Facebook on Android devices

Similar to Firefox, you may use the Chrome browser to search for plugins. Installing a different program is an additional choice that may affect Chrome’s functionality. Kaspersky SafeKids is one of the programs that Chrome on Android users may use effectively. While blocking unwanted websites and information is one of its uses, its main purpose on the Internet is to safeguard children.

Facebook Blocking Using Work Examiner

While it is feasible to block websites on a PC without having to download extra software, doing so is time-consuming and ineffective when blocking many websites. Work Examiner turns into a useful tool that will simplify the process of restricting websites and keeping an eye on their activities.

You need to follow these three easy actions in order to stop using this program to access Facebook:

  • Set Up the Work Examiner
  • It might take a few minutes to install Work Examiner on your network. Refer to the installation instructions.
  • Turn on the https filter.
  • By default, uses the https protocol. To record and prevent secure connections with Work Examiner, just activate https filtering in Client Options.
  • Make a rule for a web filter.
  • Make a web filtering rule with the URL mask*.
  • Implement the rule based on weekdays, hours, users, computers, and groups.
  • Set a daily time limit for using Facebook.
  • Set it to block, reroute, or send email notifications.
  • Web filtering technology operates independently of the kind of Internet connection.

Blocking Facebook Using Work Examiner

Facebook is no longer accessible from the targeted computer. We suggest installing this program at a business as well as for personal usage. You won’t have to prohibit a website on every computer, even if you need to restrict it on just one. It will be your responsibility to find the program on each machine and choose one as the primary. You may manage filtering policies and keep an eye on any Internet-related activity from there.

How to put the modifications to the test?

Open a command prompt, type the ping command, and check the address in the output to verify the modifications you made.

In my instance, the domain’s remote address will resolve to my local machine.

Lastly, you may choose to unblock a website that has been blocked. This is the method for doing it.


Blocking Facebook with Windows’ hosts file is an easy, reliable, and long-term method of preventing access to the website. For users who wish to ban several websites at once, it is also a useful solution.

You must update the hosts file with administrator rights to use it to ban Facebook. Your computer’s hosts file is a system file that specifies where to look for websites. You may stop your computer from accessing Facebook by adding its domain name to the hosts file and setting it to your local machine (

Extra tip:

  • Take a backup of your host file before modifying it.
  • Not only Facebook you can also similarly block other websites.

If I missed any point or had any problem let me know through comments.


On Windows, how can I ban Facebook?

How to prevent access to Facebook on a Windows or Mac computer

Step 1: Install the Freedom App after downloading it. To begin, simply download and set up the Freedom application.

Place Facebook on your block list in Step 2. Add Facebook to your list of blocked websites by logging into the Freedom website using your account.

Step 3: Get Your Block Started.

In Windows, how can I block a host file?

All you have to do to ban a certain website (like Facebook) is open your hosts file and type in 0.0. 0.0 Any address you provide after 0.0. 0.0 will not be available as it is “a non-routable meta-address used to indicate an invalid, unknown, or non-applicable target” in this case.

In what way can I lock a host file?

Go to C:WindowsSystem32driversetchosts to lock your hosts file. Then choose Properties with a right-click on the file. Set the hosts file to read-only in the Properties pane. By doing this, you may lock the file and stop others from editing it.