How to block porn sites in Ubuntu with OpenDNS
It's been a while folks! I've been busy but, I think I have to share this to you so that you know how easy to block sites especially pornography. And it is without too much configuration like my previous technique. You can even use this technique in Windows, so you don't need to my though journey:
Compiling SquidGuard for Windows (2 days) which really frustrated me => Googling for a better way (1 hour) => I found OpenDNS => Setting up (2 hour)
OK. Let's begin this in Ubuntu Jaunty (It should be OK in other Ubuntu or other Linux distros)
Create OpenDNS account
First, you must create an account. There are 3 steps.
In the first step you must create your personal information. Since I use it home, I choose "household" for "Where will you use this account?" question. Continue to next step.
Change your DNS
- In this second step, choose Computer > Ubuntu. Skip instructions from this page. Just read on.
- Change your DNS so that your internet access will go through OpenDNS for filtering. To do this you must add the following line into /etc/dhcp3/dhclient.conf
prepend domain-name-servers 208.67.222.222,208.67.220.220; - Now restart your network by doing: sudo /etc/init.d/networking restart.
- Test your configuration by accessing OpenDNS test page. or https://store.opendns.com/settings/
Basic configuration
- Go to Settings tab of your dashboard in OpenDNS site.
- Fill your current IP in "Add a network" field. You can see your current IP in right top corner. Click "Add this network".

- In the popup window, give this network a name. I typed in Home since I use OpenDNS at home.
- If you are using changing or dynamic IP address like me (FastNet), check "Yes, it is dynamic" and you must follow the next step.

- If your IP address is dynamic, install a package to tell OpenDNS you current IP. I use ddclient since it is easy to use.
Type: sudo apt-get install ddclient In its installation, just fill fields with anything you like since we will change this through configuration file. After the installation, edit /etc/ddclient.conf file:
ssl=yesuse=web, web=whatismyip.org
pid=/var/run/ddclient.pid
protocol=dyndns2
use=if, if=eth1
server=updates.opendns.com
login=yourOpenDnsAccountEgIchsan
password='youPasswordEgMySecret'
Home
mail-failure=root
mail=root
syslog=yes
Change eth1 to eth0 in use=if, if=eth1 line if ifconfig command give you eth0.
Save, and restart ddclient (sudo /etc/init.d/ddclient restart). You should see
It's time to filter
- Choose a network to configure.

- Choose custom for filtering level since we want to choose our own categories.

- Click "Apply". This should conclude this tutorial.
Happy safe browsing!

Comments
Post new comment