No Hair Blog

Installing ddclient on OpenBSD

I recently moved and decided to no longer pay my ISP for the static IP address block. I decided to go with dynamic IP addresses as, for this blog, my reader can still access the infrequent posts even if it is a bit slower.

It had been a while since I used dynamic IPs and I found a number of providers I had used in the past were no longer in service or have been swallowed by whales such as Oracle with the accompanying massive fees. I chose dynu.com because of the reviews and reasonable price ($10.00 a year for all the DNS records I would need for all my domains.

The home server I run is OpenBSD on a small fanless low power appliance (Soekris Net5501) which is adequate for the rare traffic it sees. This is behind an OpenBSD firewall (pf) and relayd as described above, which runs on another small headless appliance/server. The trick then is to get ddclient (which is in OpenBSD's package library) to work.

First, install ddclient:

pkg_add ddclient

This installs the current version (3.8.3) in /usr/local/sbin. The ddclent.conf is placed in /etc/ddclient/ddclient.conf. Now edit /etc/ddclient/ddclient.conf:


#ddclient.conf
daemon=7200                             # check every 7200 seconds (2 h)
syslog=yes                              # log update msgs to syslog
mail=root                               # mail all msgs to root
mail-failure=root                       # mail failed update msgs to root
pid=/var/run/ddclient/ddclient.pid      # record PID in file.
ssl=yes                                 # use ssl-support.  Works with
                                        # ssl-library
# postscript=script                     # run script after updating.  The
                                        # new IP is added as argument.

## For dynu.com
use=web, web=checkip.dynu.com/, web-skip='IP Address'  # Get ip from server.
server=api.dynu.com                                    # IP update server.
protocol=dyndns2                        
login=username                              # Your username
password=password                           # Your password or MD5/SHA256 of password
domain1.com
domain2.com

The old Sourceforge wiki has a list of all the cofiguration options which can be specified in the ddclient.conf file or at start time. A note: The wiki (referring to a prior version) states the default cache path is /etc/ddclient/ddclient.cache. However, in version 3.8.3 in the package library of OpenBSD, the cache is created in /var/db/ddclient/ddclient.cache.

Now start the ddclient:


doas rcctl enable ddclient
doas rcctle start ddclient

Check /var/log/messages. The install and client worked first time without problems.

Notes:

The 'rcctl enable ddclient' command places the entry 'pkg_scripts: ddclient" in rc.conf.local. If you want to review the script, it's at /etc/rc.d/ddclient.

If you want to debug your ddclient.conf before starting the daemon, use the following command to run ddclient one time with your edited ddclient.conf:

/usr/local/sbin/ddclient -pid /var/run/ddclient/ddclient.pid -daemon=0 -noquiet -debug -file /etc/ddclient/ddclient.conf


Posted by Gordon, No Hair Blog, Sept 14, 2019. Edited 9/20/19 and 10/5/19.

© nohair.net and the author

For comments, corrections, and addenda, email: gordon[AT]nohair.net

Blog | Entries | Tags | Home