(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 www.orkut.com, 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:
127.0.1.1 ubuntu.ubuntu-domain ubuntu
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
- Below 127.0.1.1 ubuntu.ubuntu-domain ubuntu, write 127.0.0.1 www.orkut.com
- Save it.
- Now try to open orkut, it will give error Firefox can't establish a connection to the server at www.orkut.com. Orkut is now blocked.
- In the same way you can block any site, just write site url after 127.0.0.1
Note: For unblock, delete 127.0.0.1 www.orkut.com