Skip to content

This Docker container provides a simple and efficient solution for dynamic DNS updates using Cloudflare DNS. It allows you to automatically update your DNS records in Cloudflare at specified intervals, ensuring that your services are always accessible through a domain name.

License

mxmlndml/cloudflare-dynamic-dns

Repository files navigation

Dynamic DNS Updates with Cloudflare

cloudflare-dynamic-dns

This Docker container offers a straightforward and efficient solution for automating dynamic DNS updates using the Cloudflare DNS service. It empowers you to effortlessly update your DNS records in Cloudflare at predefined intervals, guaranteeing that your services are consistently accessible through a domain name.

Prerequisites

Before you can use this Docker container, ensure you meet the following prerequisites:

Installation

This script runs as a Docker container, which means installation is as simple as pulling the pre-built Docker container and running it with the necessary environment variables

docker run -d -e API_KEY=123 -e ZONE_ID=023e105f4ecef8ad9ca31a8372d0c353 -e DOMAIN_NAMES=example.com,*.example.com mxmlndml/cloudflare-dynamic-dns

Alternatively you can copy the docker-compose.yml and .env.template from this repository into an empty directory of your machine, rename the .env.template to .env, edit the environment variables in both files and start the container with docker compose

docker compose up -d

Configuration

You can configure this Docker container using environment variables. Here's a breakdown of the available configuration variables:

  • API_KEY required
    Cloudflare API token with Zone Settings:Read, Zone:Read and DNS:Edit permissions
  • ZONE_ID required
    Zone ID of your website (in the right sidebar on the overview page of your site)
  • DOMAIN_NAMES required
    List of DNS A records that should store your public IP address delimited by a comma (and only a comma)
  • RECORD_TYPES defaults to A
    Whether A and/or AAAA records should be updated
    A: updates only A records
    AAAA: updates only AAAA records
    *: updates both A and AAAA records
  • INTERVAL defaults to 5
    Time interval in minutes between DNS updates

About

This Docker container provides a simple and efficient solution for dynamic DNS updates using Cloudflare DNS. It allows you to automatically update your DNS records in Cloudflare at specified intervals, ensuring that your services are always accessible through a domain name.

Topics

Resources

License

Stars

Watchers

Forks