Setting Up Dynamic DNS with ddclient
Dynamic DNS automatically updates your DNS records when your IP address changes. This is essential if your Breeze or home server has a dynamic IP from your ISP and you need consistent hostname resolution.
Install ddclient
sudo apt update
sudo apt install ddclient
Configuration
Edit /etc/ddclient.conf with your provider details. Here is an example for a common DDNS provider:
daemon=300
ssl=yes
use=web, web=checkip.dyndns.com
protocol=dyndns2
server=domains.example.com
login=your_username
password='your_token'
myhost.example.com
Provider-Specific Examples
For providers that use token-based authentication:
protocol=dyndns2
use=web, web=https://api.ipify.org
server=dynupdate.example.com
login=token
password='your_api_token'
home.example.com
Using a Custom Script
For providers without native ddclient support, use a cron-based approach:
#!/bin/bash
IP=$(curl -s https://api.ipify.org)
CURRENT=$(dig +short myhost.example.com)
if [ "$IP" != "$CURRENT" ]; then
curl -s "https://api.example.com/update?hostname=myhost&ip=$IP&token=YOUR_TOKEN"
echo "$(date): Updated IP to $IP" >> /var/log/ddns-update.log
fi
Start and Test
sudo systemctl enable --now ddclient
sudo ddclient -daemon=0 -debug -verbose -noquiet
The debug output will show whether the update was successful. Monitor /var/log/syslog for ongoing update status.