How To Block Websites In Ubuntu?

Ubuntu Logo
Wanna to block some websites on your Ubuntu system? Whole procedure is same with windows (Block Websites In Windows), only difference is location of hosts file. In windows hosts file has path C:\ WINDOWS\ system32\ drivers\ etc while in ubuntu hosts file exist under /etc directory.

Note: You must have root privileges for implementing this trick (For accessing root privileges Open terminal with shortcut Ctrl+Alt+T, type command as "sudo nautilus" without quotes, enter the root password, root directory will open). Suppose you have to block, follow the procedure:
  • Go to File System Directory (Click on File System on the right side of your root directory)
  • Now open /etc/hosts
  • Plain text document will open with info:

    *-+    localhost    ubuntu.ubuntu-domain    ubuntu

    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
  • Below    ubuntu.ubuntu-domain    ubuntu, write
  • Save it.
  • Now try to open orkut, it will give error Firefox can't establish a connection to the server at Orkut is now blocked.
  • In the same way you can block any site, just write site url after
Note: For unblock, delete

Sharing is Caring

Related Posts

Next Post »


March 25, 2012 at 2:00 AM delete

On ubuntu 11.10 if you are using firefox 11.0 then this might not work ! Im getting this strange response. When Im trying to access a blocked site using FFox it opens up but when Im trying to access it using chrome it shows me it is blocked.


Thank you for your comment.