deSEC – dyndns for Nextcloud

First register (german: registrierung) an account and wait for your personal credentials sent by email. Then start to install and configure the dyndns client. To install ddclient, use

sudo -s
apt install ddclient -y

If apt install ddclient doesn’t ask you to configure ddclient, use

dpkg-reconfigure ddclient

to start the configuration process again:

In the configuration process, select “other” dynamic DNS service provider and enter

as the dynamic DNS server. Next, tell ddclient to use the “dyndns2” protocol to perform updates. Afterwards, enter the username and password they sent you via email upon registration. Last, tell ddclient how to detect your IP address, your domain name and the update interval.

Determine IP Address Remotely

If your setup does not allow your public IP address to be determined from one of your interfaces, you can let ddclient use their servers to determine your address. To do so, you will need curl installed. Then, right above the line, simply add the following line

use=cmd, cmd='curl'

to your ddclient configuration file.

Enable SSL by Default

ddclient doesn’t use SSL by default. To fix this, open

vi /etc/ddclient.conf

and add ssl=yes above the server= statement

# Configuration file for ddclient generated by debconf
# /etc/ddclient.conf

use=if, if=eth0
use=cmd, cmd='curl'

Please substitute the red ones.

Test Your Setup

On the command line, use sudo ddclient -force to see if everything works as expected.

ddclient -force

The result should look very similar to mine:

© 2016, rieger::CLOUD

Configure the ddclient to operate in daemon mode:

vi /etc/default/ddclient.

In addition please create a cronjob to update your ip at least once per day

crontab -e
15 05 * * * /usr/sbin/ddclient --force

Now you are able to request certificates from let’s encrypt for your new dyndns-address.

Carsten Rieger