DDNS Updater is a Python program to update a dynamic IP address on a DNS server using the NIC V2.0 protocol. If hosting a private webserver connected to a NAT router the external IP address of the router must be used to get access this webserver. Since IP addresses are not made for human memory the DNS (Domain Name System) was invented. DNS resolves domain names into (static) IP addresses. IP addresses of routers change after a few weeks but DNS will not notice anything about it and returns the old IP address. The IP address needs to be updated. This update process is done by a variant of DNS the Dynamic DNS.
In order to always store the most recent IP address on the DNS server, DDNS Updater was developed. There are already some such programs elsewhere. Most of them provide useless functions, are complicated to configure and sometimes do not work properly. DDNS Updater is very slim, easy to configure and provides optional email alerts for errors and successful updates.
After adding the PM Code Works APT repository to the system package sources, the package can be installed using following command:
$ sudo apt-get install ddns-updater
Install missing dependencies:
$ sudo apt-get install -f
Edit the file
server: The domain name of DNS server providers (without http://) e.g. dyndns.strato.com.
server_path: The URL path to the DNS server directory e.g. /nic/update.
username: Account name at DNS server provider.
password: Password for account at DNS server provider.
hostname: The domain that should be provided.
ip: Do not edit this. It is maintained by DDNS Updater and contains the current IP address.
external_ip_server: An public available webserver that sends the current IP, e.g. checkip.dyndns.com. Self-hosted servers are also possible by using the simple PHP script checkip.php located in
external_ip_server_path: URL path to the directory where the PHP script is located e.g. /
use_regex: (Optional) Set to
Trueto extract the IP address out of HTML formatted HTTP response e.g. when using checkip.dyndns.com in
external_ip_server. When using self-hosted server with checkip.php script set to
notify: (Optional) Set to
Trueto enable e-mail notifications like successful IP address updates or errors. Please configure following value or set to
Falseto disable notifications. Then the following configuration is not necessary.
smtp_server: SMTP Server to send the e-mails from.
port: Port of the SMTP server e.g. 587 or 465.
username: E-mail account name.
password: E-mail account password. Don't worry: TLS is used during exchange!
recipient: E-mail account that should receive the notifications.
Every 10 minutes DDNS Updater verifies if the IP address has changed and performs an update if necessary. The interval can be changed by editing file
The configuration file
/etc/ddns-updater/ddns.conf is loaded per default during execution. It is possible to load another configuration file by using following command:
$ sudo ddns-updater --config /path/to/another/file.conf
DDNS Updater supports multiple DDNS profiles. Every section inside the configuration file specifies a profile. Per default the profile DDNS is loaded. To load another profile use the following command:
$ sudo ddns-updater --profile PROFILENAME