How to block Social Networking websites like Facebook, MySpace and others?

Today Social Networking sites have become a part of everybody’s life. It does not matter who you are and what you do, you have to be on Social Network to catch with the rest of world. Every thing comes with pros and cons, so is the Social Networking. It has many benefits and dangers too.  And if uncontrolled, can lead to loss of productivity and financially to organizations. In this post we will see how we can block social networking websites like Facebook, MySpace, Twitter, Pinterest and other.

Block Social Networking websites in Windows

Windows based systems uses a file known as hosts to search for hosts known to the system. It stores IP address and domain name of website. So we can use this file to prevent the actual sites to load in the browser or any other program on the system as this file has system wide effect.

This hosts file is located in the following folder on the windows drive (drive where windows is loaded generally C: Drive):

\Windows\System32\drivers\etc\

You need to have Administrative privileges to edit and save this file. You can follow this step to edit hosts file. Instructions assume that you are using Windows 7 OS.

  1. Click on Start.
  2. In the Search Box (For Windows XP, Click RUN) type Notepad.
  3. Now do not press Enter. Right click on the Notepad and Click on Run as administrator (For Windows XP, Click on RUN), to open the Notepad.

    windows7-notepad

    Image: Open Notepad in Windows 7

  4. If prompt for, enter Administrator Password to open Notepad.
  5. Now Go to File –> Open and enter C:\Windows\System32\drivers\etc\hosts in the file name box. REPLACE C: with your windows drive letter.
  6. Go to the last of the file and on new line enter 127.0.0.1     facebook.com .  Here 127.0.0.1 is the IP address used by localhost. This means that when we will open Facebook.com it will open the localhost. 
  7. You can add more sites in the pattern like  127.0.0.1       myspace.com.

    notepad

    Image: Windows hosts file after edit

  8. Now Save and close the file.

Now when you will try to open these restricted websites, you will be redirected to localhost and will see website setup at local web server.

Block Social Networking websites in Linux, Unix, Ubuntu

Linux based systems also uses hosts file to search for hosts known to the system. So we can use this file to prevent the actual sites to load in the browser or any other program on the system as this file has system wide effect.

On Linux system hosts file is located in the following folder:

/etc

You need to have Administrative privileges to edit and save this file. You can follow this step to edit hosts file. Instructions assume that you are using UBUNTU.

  1. Start Terminal.
  2. Edit hosts file by typing

    sudo gedit /etc/hosts.

  3. Enter Administrator’s password 
  4. Now Add following lines to block facebook.com, myspace.com

    127.0.0.1     facebook.com 
    127.0.0.1     myspace.com

  5. You can add more sites in the same pattern.
    ubuntu-hosts-file
  6. Now Save and close the file.
  7. Restart the system. And you are done.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.