Do you have a dynamic IP connection and your domain service has DDNS? Possible, it also accept DDClient to update your A or AAAA records with your dynamic IP. Unfortunately, of the time of this article, the DDClint at NetBSD repositories only accept IPv4. Thus if you need IPv6, you got a problem.
Below, there’s the procedure to install the current version from GitHub on a NetBSD system.
First, supposing that you still don’t have installed pkgin to make use of binary packages on NetBSD beyond pkgsrc, who is a overkill just to install a single small application, configure it:
Febronia# PKG_PATH="http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/9.2/All/"
Febronia# export PKG_PATH
Febronia# pkg_add pkgin
pkg_add: Warning: package `pkgin-21.7.0' was built for a platform:
pkg_add: NetBSD/earmv7hf 9.0 (pkg) vs. NetBSD/earmv7hf 9.2_STABLE (this host)
pkg_add: Warning: package `pkg_install-20210410' was built for a platform:
pkg_add: NetBSD/earmv7hf 9.0 (pkg) vs. NetBSD/earmv7hf 9.2_STABLE (this host)
pkgin-21.7.0: copying /usr/pkg/share/examples/pkgin/repositories.conf.example to /usr/pkg/etc/pkgin/repositories.conf
After that, the second step is to install the DDClient dependencies:
Febronia# pkgin install p5-JSON-XS p5-IO-Socket-SSL p5-IO-Socket-INET6 curl ca-certificates p5-Data-Validate-IP
Now, to the main course, the DDClient itself. Download it with curl, uncompress it at some folder, and check if it can execute:
Febronia# curl -L https://github.com/ddclient/ddclient/archive/refs/tags/v3.9.1.tar.gz > v3.9.1.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 63469 0 63469 0 0 24416 0 --:--:-- 0:00:02 --:--:-- 203k
Febronia# tar -xvf v3.9.1.tar.gz
Febronia# cd ddclient-3.9.1/
Febronia# /usr/pkg/bin/perl ./ddclient --help
Move the script to a folder at the $PATH of your system, and do a sed command to change the path of the perl interpreter that it should use to execute itself, without that, it will fail to execute. Test the ddclient with a simple –help after it to check if it worked.
Febronia# mv ddclient /usr/bin
Febronia# sed -i'' -e 1H -e "1i\\
#!/usr/pkg/bin/perl -w" /usr/bin/ddclient
Febronia# ddclient --help
Create the configuration folder, and the file. Use either Vi or install another editor, like nano, using pkgin for that
Febronia# mkdir /etc/ddclient/
Febronia# vi /etc/ddclient/ddclient.conf
Most of the configuration file depends on settings given by your DDNS provider. In this case bellow, it’s namecheap. Other at the DDClient configuration samples at GitHub.
Main and foremost for IPv6 support, is to use the cmd configuration key followed by the command to be executed to filter the ifconfig output. Test this command on the shell with the name of your network interface before customizing it for your needs.
daemon=1200 # check every 300 seconds
syslog=yes # log update msgs to syslog
mail=whatever # mail all msgs to root
mail-failure=whatever # mail failed update msgs to root
pid=/var/run/ddclient.pid # record PID in file.
ssl=yes
ipv6=yes
use=cmd, cmd='ifconfig emac0 | grep inet6 | cut -d " " -f 2 | cut -d "/" -f 1 | tail -1'
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=example.com
password=example.com-password
@
And that’s it. And this is the part where the author of this article fall flat on the floor after learning that NameCheap DDNS service doesn’t support IPv6. But I will keep it there just in case someone else find all of that above useful for another DDNS provider.