domingo, 18 de noviembre de 2012


para bloquear paginas web en ubuntu facil

First, find the IP addresses of the sites you want to access, you can do this by using nslookup or dig from the command line or a site like this http://ip-lookup.net/domain.php

The use your favourite editor and edit /etc/host you need to edit is file as the root user so go to console and type
sudo pico /etc/hosts or
sudo gedit /etc/hosts

and add one line for each of the sites you want to access, I'll use Mahalo as an example. you need to put in the www.domain if you want to access it too.

166.90.81.138 mahalo.com www.mahalo.com

then save the file
then edit using sudo pico or sudo gedit /etc/nsswitch.conf

find the line that look like this

hosts: files dns
and change it to this
hosts: files

save the file and you done. When you close and reopen your browser you will be blissfully cut off from the internet except for the sites you put in your hosts file.

P.S., When you do this you better have a backup plan for accessing the internet.