This guide shows how to install and setup the dynamic dns client (ddclient) in Ubuntu to update your dynamic IP address with the dynamic DNS service provided by Zoneedit.com. This is useful for anyone who is running a home server using an internet connection which has a dynamic IP. I am using Ubuntu in this example, but I suspect the setup would be similar using any linux server.
I use zoneedit.com because it allows the use of your own domain name for free. It seems most people use dyndns.com, however you must pay for that service if you want to use your own custom domain, which kind of suks.
First you need your own custom domain (mydomain.com), an account with Zoneedit with an (A) record already setup. I will not cover details of setting up the records in this guide, however you can find more details of using Zoneedit here.
This guide will also assume you have your Ubuntu server up and running already.
1.) First you need to install some packages on your Ubuntu server which you want syncing with Zoneedit. I will use apt but you can also use synaptic or apptitude. To use apt, type the following command line:
:~$ sudo apt-get install ddclient ssh libio-socket-ssl-perl
At the prompts you will be asked to select your DNS provider. You should select Zoneedit and then input the appropriate values, for example:
- Fully qualified domain names: mydomain.com
- Username for dynamic DNS service: your-zoneedit-username
- Password: your-zoneedit-password
- Enter the interface which is used for using dynamic DNS service: web
2.) After the installation is complete, you need to manually configure /etc/ddclient.conf. Edit this file with your favorite text editor, myself I like to download locally and use Uedit, so i have a backup copy in case anything goes wrong later. If you have gEdit installed, you can type the following command line:
:~$ gksu gedit /etc/ddclient.conf
You need to modify the /etc/ddclient.conf file 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:
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
daemon=300
pid=/var/run/ddclient.pid
ssl=yes
protocol=zoneedit1
## use=if, if=web
use=web, web='http://www.zoneedit.com/checkip.html/', web-skip='IP Address'
## server=www.zoneedit.com
server=dynamic.zoneedit.com
login=your-zoneedit-username
password='your-zoneedit-password'
mydomain.com
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″
Note: 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.) Now a word of warning. Just because ddclient restarted correctly does NOT mean that it is syncing your IP address correctly with Zoneedit. You can check the Syslog to see if the syncing of your IP is successful by looking through /var/log/syslog. A simple method is to use tail to do this:
:~$ tail -f /var/log/syslog
If you see something at the end of Syslog that looks similar to this:
Feb 5 21:16:36 ddclient[12034]: SUCCESS: updating mydomain.com: IP address set to (200: Update succeeded.)
then ddclient should be working fine. However, if you get something similar to the following, you should check your /etc/ddclient.conf and /etc/default/ddclient configurations:
Feb 5 21:13:44 tux ddclient[11788]: WARNING: caught SIGTERM; exiting
Feb 5 21:13:45 tux ddclient[11894]: FATAL: Error loading the Perl module IO::Socket::SSL needed for SSL connect.
