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)
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:
Save and exit, the reboot your system with this command:
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.