Update Cloudflare DNS Records with the public IP address
1.5K
DNS Updater is a Python-based tool that automatically updates Cloudflare DNS records with your public IP address. If your server's IP address changes frequently or you have a dynamic IP, this tool ensures that your domains and subdomains always point to the correct server. It can handle multiple domains and subdomains from multiple zones, with proxying enabled or disabled. The tool runs checks and updates every 5 minutes and includes redundancy for IP checking services.
#Docker compose for cloudflare-dns-updater
version: "3.6"
services:
cloudlfare-dns-updater:
image: "spaskifilip/cloudflare-dns-updater:latest"
container_name: "cloudlfare-dns-updater"
volumes:
- app-data:/app # optional unless using the domains.json file and DOMAINS_FILE_PATH variable
environment:
CF_API_TOKEN: "YOUR_API_TOKEN" # Recomended to create a token for the zones, not use the main token
CF_ZONE_ID: "YOUR_ZONE_ID1,YOUR_ZONE_ID2" # Can be only 1 zone ID (usually is)
# Choose the method in which you get your domain records:
# You must choose one method
# DOMAINS_FILE_PATH is not needed if the DOMAINS or DNS_RECORD_COMMENT_KEY variables are set.
# Edit the domains.json according to the example file in the mounted volume.
# If you don't mount a volume, you cannot use the domains.json file and DOMAINS_FILE_PATH variable.
DNS_RECORD_COMMENT_KEY: "Comm1,Comm2" # Any DNS reccord that has any of the comments specified here. Can be 1 comment
#DOMAINS: "domain.com,example1.domain.com,example2.domain.com"
#DOMAINS_FILE_PATH: .\domains.json
SCHEDULE_MINUTES: 5
PROXIED: True # if proxied is set to True, TTL cannot be set/changed
TYPE: A # Supports either A, AAA or CNAME
TTL: 1
# Uncomment the following 3 vars if you want to change the Proxy, TTL and Type (usually it's set once, and no need to change)
#UPDATE_TYPE: True
#UPDATE_PROXY: True
#UPDATE_TTL: True
restart: "unless-stopped"
volumes:
app-data:
driver: local
driver_opts:
o: bind
type: none
device: /volume1/docker/cloudflare-dns-updater
{
"zones": [
{
"id": "$CF_ZONE_ID",
"domains":
[
{
"name": "sub1.example.com"
},
{
"name": "sub2.example.com"
},
{
"name": "example.com"
}
]
}
]
}
To obtain the Zone ID for your domain from Cloudflare, follow these steps:
For any issues, open a ticket at https://github.com/SpasovskiFilip/dns-updater
Content type
Image
Digest
sha256:3a618ca3a…
Size
20.8 MB
Last updated
about 1 year ago
docker pull spaskifilip/cloudflare-dns-updater