Thursday, February 05, 2009

This post explains how to install and setup the dynamic dns client ddclient to sync your dynamic IP address with the dynamic DNS service Zoneedit.com. Most of the howto's I've seen only cover setups for dynamic DNS services like dyndns.com. I prefer Zoneedit.com because it is simple and free.

I am assuming you have a domain name (yourdomain.com), an account with Zoneedit, and that you have setup the appropriate records in your Zoneedit account for your domain. I am also assuming that you have installed/setup Ubuntu. This Howto has been tested on Ubuntu 8.04 through 12.04 with success. This Howto may work with other versions of Linux.

For the purpose of this howto, I will use the (A)-record that I've created in Zoneedit called "tux.yourdomain.com". So on with the show:

1.) First you need to install some packages on your Ubuntu machine from the location that you want syncing with Zoneedit. You can use synaptic, apptitude or apt. To use apt, type the following into the terminal:

:~$ sudo apt-get install ddclient ssh libio-socket-ssl-perl

At the prompts you will be asked to select your Dns provider. You need to select Zoneedit here and input the appropriate values, for example:

2.) After the installation is finished, you need to configure /etc/ddclient.conf. You can edit this file with vim or your favorite text editor. To open the file in Gedit, you can type the following into terminal:

:~$ gksu gedit /etc/ddclient.conf

You need to modify the /etc/ddclient.conf and add entries for "daemon", "ssl" and replace "use=if, if=web" with "use=web, web='http://www.zoneedit.com/checkip.html/', web-skip='IP Address'" to match the following example:

Update: It has been recommended in the comments that you change:
www.zoneedit.com/checkip.html
to
legacy.zoneedit.com/checkip.html.

3.) Now open /etc/default/ddclient:

:~$ gksu gedit /etc/default/ddclient

Check that /etc/default/ddclient contains the following lines:

run_ipup="false"run_daemon="true"daemon_interval="300"

You can set the interval shorter or longer in /etc/default/ddclient, but if you do, also correct your /etc/ddclient.conf to match.

4) You can now restart ddclient with your new configurations.

:~$ sudo /etc/init.d/ddclient restart

To check the status of the ddclient daemon:

:~$ sudo /etc/init.d/ddclient status

If you do not get an error similar to the following, the ddclient deamon has probably restarted without any issues:

WARNING: file /etc/ddclient.conf, line x

5.) Just because ddclient restarted correctly does NOT mean that it is syncing your IP address correctly with Zoneedit. Since ddclient writes logs to Syslog, you can check to see if the syncing of your Ip is s Success by looking through /var/log/syslog. I use tail to do this in the following way:

Thanks to DAnny Flack and Florynce, in the comments below, a solution for fixing this warning is suggested. The suggestion is to delete the cache file: /var/cache/ddclient/ddclient.cache and to restart ddclient. This can be done in the following way:

I don't know if it was related to my problem, but I had to delete the cache file: /var/cache/ddclient/ddclient.cache because I was getting this error after your steps:WARNING: file /var/cache/ddclient/ddclient.cache, line 3: Invalid Value for keyword 'ip' = ''