To execute dynamic DNS updates with your current IP address you may use DDclient, a program that runs on a Linux server in your home network. Learn about the use case and get install and configuration tips here in this article.
Many consumer internet connections get only a dynamic IP address assigned. The IP address changes every time when the router (re-)connects to the internet. To connect from outside to your home via the internet, you need to use the current external IP address assigned to your router at the time you connect. A dynamic DNS service helps to always have your current IP address of your home at hand.
- Dynamic IP addresses and how you can connect to your home from outside
- Dynamic DNS with Telekom Speedport Smart Routers
To ensure that the dynamic DNS service you use always has your current home IP address available, the best option is that the router triggers the update. The router as the only device directly connected to the internet (WAN) knows when the external IP address has changed and can then trigger the dynamic DNS update. But in cases where a the router does not support dynamic DNS updates, a small tool DDclient may become handy. DDclient is a Perl client used to update dynamic DNS entries for accounts on Dynamic DNS Network Service Provider.
It runs on a Linux system in your home network, e.g. on a NAS system or a small Raspberry Pi based server. Most Linux distributions have a recent version of DDclient packaged. On Debian-based systems such as Ubuntu or Raspberry OS you can easily install it with
sudo apt install ddclient.
The configuration of DDclient is in configuration file:
If you installed DDclient by using the installer of your distribution, it probably already asked you some questions and prepared a useful config file.
You can get an overview of the configuration parameters and the configuration file definitions with
Start, Stop, Restart
Once the configuration is done, you can check and debug with
sudo ddclient -daemon=0 -debug -verbose -noquiet
If the update run as expected, run DDclient as a daemon. It will monitor the external IP address and send an update whenever needed to the dynamic DNS service.
To force an update to the dynmic DNS service (e.g. dynamic DNS entry has been set manually, but an update through the current IP address is needed), you can run
sudo ddclient --force
To run as a service:
sudo service ddclient start
To stop the service:
sudo service ddclient stop
sudo service ddclient restart
sudo service ddclient status
Configuration for namecheap.com dynamic DNS
If want to use namecheap.com as your dynamic DNS service, you can use DDclient to update your IP address.
Further reading: Dynamic DNS with a Namecheap registered domain name
The DDclient.conf file for the domain "dyntest.airix.net" and password "topsecret" can be defined as follows:
# /etc/ddclient.conf for namecheap.com
The parameter use=web defines that the current IP address is determined via the web using dynamicdns.park-your-domain.com/getip (this is defined with parameter web=...).
protocol is the standard used for the dynamic DNS update, here it is namecheap
The update server (server=) is accessed using dynamicdns.park-your-domain.com
login= refers to the domain name that holds the dynamic DNS entry, i.e. your domain registered with namecheap.com
password= is the dynamic DNS password of your domain and, on the last line, it is the hostname of the dynamic DNS record
Additional Links (External):