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.

Don’t forget to backup your Nextcloud

Find more instructions here: Nextcloud backup and restore

Carsten Rieger

Carsten Rieger

Carsten Rieger is a senior system engineer in full-time and also working as an IT freelancer. He is working with linux environments for more than 15 years, an Open Source enthusiast and highly motivated on linux installation and troubleshooting. Mostly working with Debian/Ubuntu Linux, Nginx and Apache web server, MariaDB/MySQL/PostgreSQL, PHP, Cloud infrastructure (e.g. Nextcloud) and other open source projects (e.g. Roundcube) and in voluntary work for the Dr. Michael & Angela Jacobi Stiftung for more than 7 years.