How to Block Facebook
Facebook is a great way to stay connected to people and has plenty of benefits, but that’s not why we’re here, we’re here to block access to Facebook. Why? Well, there are many reasons to block the site, companies often block the site to prevent employees from accessing it on company time, and parents may want to block Facebook to keep their young children away from some of the more mature content.
Then there are people like me, you like the site but you find Facebook to be an enormous distraction when trying to be productive. Sometimes the easiest way to eliminate the distraction is by forcibly blocking a site along with others that are blackholes of time. I actually have Facebook and a handful of other sites permanently blocked on my work machine, it has kept me free from distractions and I’m sure it helps my productivity. Without further ado, let’s find out five different ways to block Facebook.
5 Ways to Block Facebook
You’ve decided you want to block Facebook, we’ll cover various ways to achieve this. This will include specific methods for Mac and Windows, and also ways to block Facebook from an entire network using a router or custom DNS. Before you ask, yes these methods work for blocking other websites and domains as well.
Block Facebook system-wide using the Hosts file
By editing the hosts file, you will block Facebook (or other specified websites) from all applications on that computer. This is actually the method I use when I’m trying to block a website because it’s so easily reversible and it’s system-wide.
How to block Facebook with the Hosts file in Mac OS X:
This works in all versions of Mac OS X.
- Launch the Terminal, located in /Applications/Utilities/
- At the command line, type: sudo open /etc/hosts
- Enter your administrative password when asked
- TextEdit will now launch with /etc/hosts open, you need to add the following lines to the bottom of the file
- Each one of those entries must be on it’s own line. Save the file when it’s finished editing
- Now you need to flush the DNS cache for changes to take effect, type the following command in the Terminal: dscacheutil -flushcache
- Try to access facebook, it should no longer work
If you remove the entires from the /etc/hosts file you will be able to access Facebook again as usual.
How to block Facebook with the Hosts file in Windows:
This works for Windows XP, Windows Vista, and Windows 7.
- Locate your Windows hosts file, at C:\WINDOWS\system32\drivers\etc\hosts
- Open this file in your favorite text editor, Notepad works fine
- Add the following lines to the hosts file:
- Reboot your Windows PC and try to access Facebook, it should be blocked
You can then unblock Facebook by simply removing the entries from the hosts file.
Blocking Facebook with Internet Explorer
If you’re trying to block Facebook from a PC and the primary browser is Internet Explorer, you can add it to a built-in block list:
- Open Internet Explorer and click on the ‘Tools’ menu
- Click ‘Internet Options’
- Click on the ‘Content’ tab
- Click the ‘Enable’ button
- Click on the ‘Approved Sites’ tab
- Type www.facebook.com in the box
- Click ‘Never’ and then click ‘OK’
- You’ll be asked to enter and confirm a password, do this and don’t forget the password
- Now click on the ‘General’ tab and select ‘Users can see websites that have no ratings’
- Click OK
You can do the same type of browser blocking with Safari, Chrome, and Firefox, but this is really the worst method since you can get around it so easily by just using another browser.
Temporarily blocking Facebook and other sites with SelfControl
If some of this is overkill to you, another solution for Mac users is to use an app called SelfControl which blocks distracting websites on your machine for a set amount of time. It includes a fully customizable blacklist so you can add and remove any site that is wasting your time quite easily.
Blocking Facebook from being accessed by an entire network
Perhaps you’re an office or school and you want to prevent your employees and students from accessing Facebook from your network. I know of several companies that do this for security reasons, and others block sites that they feel are not related to the task you should be performing. The easiest way to block sites is at the router, firewall, or DNS level. The other advantage to this method is that it should prevent someone from accessing Facebook from even an iPhone or Android phone, assuming it is connected through the wireless network.
Blocking Facebook on the Router
If you want to have a network-wide block of Facebook, all you need to do is add it to the block list on your router. I’ve seen this done countless times at offices, coffee shops, libraries, schools, and it’s one of the easiest ways to block everyone from accessing the site. The ability to block sites is usually labeled something along the lines of “Internet Access Policy” or “Domain Management” so you’ll have to look around in your router settings for the option. After you find it, it’s just a matter of adding the domains and saving the changes to the router, which will effect all machines that connect to the internet from that access point.
Block Facebook with OpenDNS
Using OpenDNS you can block Facebook or any other domains by adding them to a custom block list. Here’s the process for OpenDNS:
- Add a network to your OpenDNS account via the account Dashboard
- Navigate to “Settings” and select the network you want to block the site on
- Select “Manage Individual Domains”
- Select “Always Block” and then type in the domain you want to block (in this example, facebook.com)
This will effect all computers that are using the OpenDNS account to access the internet, if you have this set on a router, it will effect all the machines that connect to that router. Changes to OpenDNS are generally pretty quick, but it may take up to 15 minutes. You’ll also need to flush the DNS cache or reboot each machine that connects to the network for the changes to take effect, for this reason it might be a good change to make after work/school hours when network machines are shutdown anyway.
What about unblocking Facebook?
Of course there’s two sides to every coin, so what if you’re on a machine with Facebook blocked? If the site is blocked at the router or DNS level, you are out of luck without knowing the login information for those, or you’ll have to use a proxy service. If you suspect the block is on a PC-level, you can simply go through the directions above to see if Facebook has been blocked using any of those methods. For example, if you see the domain included in the hosts file, you can just remove it from the hosts file and you will be able to unblock the site and access it again.