This Dockerized project automatically updates a Cloudflare DNS A record to match the public IP.
984
This project provides a simple Dockerized solution to automatically update a Cloudflare DNS A record to match the public IP address of a device. The updater checks the public IP at specified intervals and updates the DNS record if there is a change.
Before running the Docker container, you need to set the following environment variables:
CF_API_TOKEN: Your Cloudflare API token. How toDNS_RECORD_NAME: The name of the DNS A record you wish to update (e.g., test.example.com).CHECK_INTERVAL_MINUTES: The interval (in minutes) at which the script checks the public IP address (default is 10 minutes).Build the Docker Image
Navigate to the directory containing the Dockerfile and run:
git clone https://github.com/bariskisir/ShellCloudflareDnsUpdater
cd ShellCloudflareDnsUpdater
docker build -t shellcloudflarednsupdater .
Run the Docker Container
Use the following command to run the container, replacing the environment variable values as needed:
docker run -d \
--name shellcloudflarednsupdater \
-e CF_API_TOKEN="your_cloudflare_api_token" \
-e DNS_RECORD_NAME="test.example.com" \
-e CHECK_INTERVAL_MINUTES="10" \
--restart unless-stopped \
bariskisir/shellcloudflarednsupdater
This command will run the container in detached mode, checking and updating the DNS record as necessary.
The update_dns.sh script performs the following tasks:
This project is licensed under the MIT License. See the LICENSE file for more information.
Content type
Image
Digest
sha256:ffbf1a5bd…
Size
6.4 MB
Last updated
3 months ago
docker pull bariskisir/shellcloudflarednsupdater