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 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.0.1 localhost
127.0.1.1 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 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
1 comments:
commentsOn 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.
ReplyThank you for your comment.