A collection of thoughts, ramblings and experience of making technology work for me. It may include some further diversions.

OpenDNS with ddclient to maintain Dynamic DNS

OpenDNS markets itself as the fastest growing internet security and DNS service. OpenDNS is the leading provider of security and infrastructure services that make the Internet safer through integrated Web content filtering, anti-phishing and DNS. OpenDNS services enable consumers and network administrators to secure their networks from online threats, reduce costs and enforce Internet-use policies.

For OpenDNS to work the service needs to know which IP address your network resides on. If like me your internet service provider assigns you a dynamic IP address then you have to setup a dynamic updating service that keeps OpenDNS updated with your current IP address. This posts walks through the steps I used to set up ddclient (a linux dynamic dns updating tool) with OpenDNS. Read on...Ideally ddclient needs to be running on a machine which is run 24/7 so that OpenDNS is always aware of your networks current IP.

Install ddclientUnder Ubuntu 10.04 I used the following command to install ddclient and its dependencies:sudo apt-get install ddclient

Configure ddclientEdit the configuration file for ddclient using the command below:sudo gedit /etc/ddclient.conf

Set the config file permissionsddclient requires the config file to be readable only by the file owner (root by default):sudo chmod 600 /etc/ddclient.conf

Set up the ddclient daemonTo get ddclient to run as a service, you need to make some additional changes to get the service daemon up and running:sudo gedit /etc/default/ddclient

Add the lines:

# Configuration for ddclient scripts
# generated from debconf on Sat Jul 16 14:16:54 BST 2011
#
# /etc/default/ddclient
# Set to "true" if ddclient should be run every time a new ppp connection is
# established. This might be useful, if you are using dial-on-demand.
run_ipup="false"
# Set to "true" if ddclient should run in daemon mode
# If tis is changed to true, run_ipup must be set to false.
run_daemon="true"
# Set the time interval between the updates of the dynamic DNS name in seconds.
# This option only takes effect if the ddclient runs in daemon mode.
daemon_interval="300"

Set the ddclient daemon to run at bootTo run the daemon at boot time I edited the rc.local file, you should probably use System V init scripts instead but I was being lazy:sudo gedit /etc/rc.local

Add the line:

sudo /etc/init.d/ddclient start

Run the ddclient to test it worksFrom a terminal run:sudo /etc/init.d/ddclient start