Pages

Saturday, October 6, 2012

How To Block Access To Facebook (HTTP & HTTPS) On Ubuntu 12.10/12.04/Linux Mint 13



Facebook is a popular social networking site that allows users to stay connected with their friends and family online. Sometimes, Facebook may have some disadvantages like parents worrying that their children will be addicted to Facebook, and the bad effect that Facebook addiction may bring on students results. Also, using this distracting social media website may decrease productivity in work-related environments (office, companies, etc.).

Whether you want to block access to Facebook for yourself or keep other users from doing so, you can easily follow this simple method to block access to Facebook under Linux-based systems. The method will block access to both HTTP and HTTPS protocols and can be used in the following Linux distributions:


  • Ubuntu 12.10/12.04/11.10
  • Linux Mint 13/12
  • Debian 6.0 (Squeeze)
Getting Started

1. Open the terminal and edit the /etc/hosts file with this command:

sudo gedit /etc/hosts

Note: For Linux Mint, you can use "pluma" instead of "gedit".
2. At the end of the file, add these lines:
# Block Facebook
127.0.0.1 www.facebook.com


Save and exit, the reboot your system with this command:

sudo reboot

You have now remapped "facebook.com" to 127.0.0.1. Anyone who tries to browse Facebook will get this:


Note: You can use this method to block other websites.