
DDNS

π Automating Cloudflare DDNS with a Shell Script
To keep my self-hosted services accessible, I built a Cloudflare DDNS updater using a Bash script. This solves the problem of dynamic IP changes from my ISP by automatically updating my domain (michaelcozierdns.com) to point to the correct public IP.
Why Cloudflare DDNS
Cloudflare offers fast DNS propagation, built-in DDoS protection, and API access for easy DNS management. It integrates well with Traefik, allowing me to securely route traffic to services like Pi-hole, Prometheus, and Netdata.
How It Works
The script detects my current public IP, compares it with the Cloudflare DNS record, and updates the record if they differ. It also supports notifications via Slack and Discord and logs updates for auditing. I automated the process with a cron job, running every 5 minutes to ensure my domain stays reachable.
Why Itβs Useful
This setup keeps my domain accessible despite IP changes, gives me complete control over my DDNS setup, and integrates seamlessly with my self-hosted services. Automating infrastructure like this helps maintain reliability without relying on third-party tools.
This project reinforced my skills in API automation and DNS management β essential for resilient self-hosted environments.