This project provides a lightweight Alpine-based Docker container that runs a Python script every 15 minutes. The script checks if your public IP address (assigned by your ISP) has changed, and if so, updates your DNS records on Cloudflare accordingly.
Anyone hosting services from a home network and needing reliable, public DNS updates.
-
From your Cloudflare account, obtain your Zone ID and generate a custom API token with the following permissions:
- All Zones:
- Zone Settings: Read
- Zone: Read
- DNS: Edit
- All Zones:
-
Copy the
.env.dev
file and update it with your credentials. -
Specify the DNS record type and names you want monitored and updated. For example:
DNS_RECORDS=A:mail.my.domain,A:my.domain
docker run -d \
--name cloudflare-ddns \
--init \
--env-file .env.dev \
--restart unless-stopped \
ghcr.io/struxoje/cloudflare-ddns:latest
If you prefer to build the container yourself:
-
Clone the repository:
git clone https://github.com/struxoje/cloudflare-ddns.git
-
Modify
build-container.sh
to push the container to your preferred registry. -
Run
build-container.sh
on a Linux system or Apple Silicon Mac. -
Update the
.env.dev
file as described above and start the container using the provideddocker run
command.
Feel free to reach out with any questions or issues.