Friday, May 28, 2010

How to set DDclient for OpenDNS in Ubuntu Linux

OpenDNS is one of the public domain name servers available to the users.
When setting the DNS IP address to 208.67.222.222 or 208.67.220.220 your client will lookup the domain name using OpenDNS servers. Apart from the security advantages (that I don’t want to discuss here) one killing feature of OpenDNS is the possibility to effectively set content filters for your client computers.

Imagine you’re a father and don’t really want your 6 years old kid to stumble upon (yes you can involuntarily stumble upon them) adult websites while surfing the web. You should be with your kid when he/she does but we know that this isn’t always possible even at home. OpenDNS gives the user the possibility to filter several categories of websites and even to create personal blacklists and whitelists.



The problem is that OpenDNS recognizes a user through his/her IP address. This works fine in case of static IP but doesn’t work with dynamic IP addresses that are assigned by the ISP to the user at every session.
DDclient is what we need to do the trick. It’s basically a perl client designed to catch the user’s IP address and perform the update of that for certain services.
You can find and install the script directly from the repositories, just look for DDclient in Synaptic.

While performing the installation the script will render a setup form that you must fill in with basic data about the task DDclient has to do.
Anyway I found that also by filling in the form the IP address update for OpenDNS doesn’t work. This is not a big deal because we are gonna modify the configuration script.
Open a terminal and type:

sudo gedit /etc/ddclient.conf

Enter the following information in the text file

/etc/init.d/ddclient status


sudo ddclient


ssl=yes


# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf


pid=/var/run/ddclient.pid
use=web, web=whatismyip.org
protocol=dyndns2
use=if, if=eth0
server=updates.opendns.com
login=XXXXXXXXXXX
password=XXXXXXXXXX
Home

Customize the following data:
login --> your login name in OpenDNS
password --> your password account in OpenDNS
Home --> change this with whatever name you gave to your network in OpenDNS

Save the script and close.
Now type:

sudo /etc/init.d/ddclient status

This will check if DDclient in running. The ouput should be something like this: Status of Dynamic DNS service update utility: ddclient is running

DDclient is configured by default to run as a deamon, therefore you shouldn’t have to do anything. Should you have issue with it running check first the configuration file to spot syntax or command errors. You could also type sudo /etc/init.d/ddclient restart to see an error output.

To check the update of the IP in your machine try to switch off and on the router a few times, obtain a new IP address from your ISP and check the setting page of OpenDNS. You should see the new IP address associated with your network (gives a few minutes to the trick to happen though). You could also monitor changes in /var/log/syslog

Well, you’re now set up to effectively filter what your kids will access on the web.

No comments:

Post a Comment