An Alpine-based microservice within Docker, designed to seamlessly manage and update Cloudflare records whenever a change is detected in your publicly-facing IP address.
This solution proves invaluable for those who self-host using a dynamic IP address, ensuring the uninterrupted integrity of their Cloudflare DNS records.


docker pull jtmb92/cloudflare-ip-checker
A simple docker run command gets your instance running.
docker run --name ip-checker-container \
-e EMAIL="[email protected]" \
-e API_KEY="your-cloudflare-api-key" \
-e ZONE_ID="your-cloudflare-zone-id" \
-e WEBHOOK_URL="your-discord-webhook-url" \
-e DNS_RECORDS="my.site.com/A site.com/A" \
-e REQUEST_TIME=120 \
jtmb92/cloudflare-ip-checker
Run on Docker Compose (this is the recommended way) by running the command "docker compose up -d".
version: '3.8'
services:
ip-checker:
image: jtmb92/cloudflare-ip-checker
environment:
EMAIL: '[email protected]'
API_KEY: 'your-cloudflare-api-key'
ZONE_ID: 'your-cloudflare-zone-id'
WEBHOOK_URL: 'your-discord-webhook-url'
DNS_RECORDS: 'my.site.com/A site.com/A'
REQUEST_TIME: '2m'
Similar to the above example, the key difference here is that we are running with the build: argument instead of the image: argument. The . essentially builds the Docker image from a local Dockerfile located in the root directory where the docker compose up -d command was run.
version: '3.8'
services:
ip-checker:
build: .
environment:
EMAIL: '[email protected]'
API_KEY: 'your-cloudflare-api-key'
ZONE_ID: 'your-cloudflare-zone-id'
WEBHOOK_URL: 'your-discord-webhook-url'
DNS_RECORDS: 'my.site.com/A site.com/A'
REQUEST_TIME: '120'
Meant for advanced users Here's an example using the Loki driver to ingress logging over a custom Docker network while securely passing in ENV vars.
version: "3.8"
services:
cloudflare-ip-checker:
image: "jtmb92/cloudflare_ip_checker"
restart: always
networks:
- container-swarm-network
environment:
API_KEY: ${cf_key}
ZONE_ID: ${cf_zone_id}
WEBHOOK_URL: ${discord_webook}
DNS_RECORDS: 'my.site.com/A site.com/A'
REQUEST_TIME: "5m"
EMAIL: ${email}
deploy:
replicas: 1
placement:
max_replicas_per_node: 1
logging:
driver: loki
options:
loki-url: "http://localhost:3100/loki/api/v1/push"
loki-retries: "5"
loki-batch-size: "400"
networks:
container-swarm-network:
external: true
jtmb92/cloudflare_ip_checker
EMAIL: '[email protected]'
Your Cloudflare account email address. This is used to authenticate with the Cloudflare API.
API_KEY: 'your-cloudflare-api-key'
Your Cloudflare API key. This key is required for making authenticated requests to the Cloudflare API.
ZONE_ID: 'your-cloudflare-zome-id'
The ID of the Cloudflare DNS zone where your records are managed. This identifies the specific zone to update.
WEBHOOK_URL: 'https://discord.com/api/webhooks/<redacted>/<redacted>'
The URL of your Discord webhook. This is where notifications will be sent when IP changes are detected.
DNS_RECORDS: 'my.site.com/A site.com/A' #example of multiple list format entries
A space-separated list of Cloudflare DNS records in the format "name/type". These records will be checked and updated if necessary.
REQUEST_TIME: '10' #amount of time in seconds between next set of API requests.
REQUEST_TIME: '2m' #amount of time in minutes between next set of API requests.
REQUEST_TIME: '1h' #amount of time in hours between next set of API requests.
REQUEST_TIME: '1d' #amount of time in days between next set of API requests.
The time to wait between IP checks. This determines the interval at which the script checks for IP changes.
Content type
Image
Digest
sha256:327389e94โฆ
Size
53.1 MB
Last updated
over 2 years ago
docker pull jtmb92/cloudflare_ip_checker