ddclient is a program that sends a request to a dynamic DNS provider to update your DNS entry.
Before you start using ddclient you need to be registered on a supported dynamic DNS provider, check the ddclient website to find a list of providers available. ZoneEdit was my choice because it provides the service for free for up to 5 domain names.
Installing ddclient for Ubuntu
From the command line:
$ sudo apt-get install ddclient
Configuring ddclient
There are two configuration files for ddclient in Ubuntu:
- /etc/default/ddclient contains some of the default settings
- /etc/ddclient.conf an almost empty file for you to entered your configurations
Retrieving Your WAN IP Address
ddclient provides many options of where you can retrieve your WAN IP address from e.g. network card, command line, router/firewall, etc. Visiting the ddclient website under “supported routers” will list out all the options which you can use. I decided to use the fw option and obtain my IP address from my router by specifying the location of my router’s status page. In the /etc/ddclient.conf
use=fw
fw=<router's ip address>/<status page uri>
fw-login=<router's admin username>
fw-password=<router's password>
Communicating with Dynamic DNS Provider
ddclient provides support for a many of the most popular dynamic DNS providers. A list of supported providers can be found in their website under “supported protocols”. As I mention above I use ZoneEdit as my provider. In the /etc/ddclient.conf
protocol=zoneedit1
server=www.zoneedit.com
login=<zoneedit username>
password=<zoneedit password>
<my.domain.name, my2nd.domain.name>
Running ddclient as a Daemon
To run ddclient as a daemon modify the /etc/default/ddclient configuration file.
set run_daemon="true"
Troubleshooting
To help you troubleshoot you can run ddclient on the command line with debugging and verbose messages enabled.
$ ddclient -debug -verbose