This small Alpine Linux based Docker image will allow you to use the free CloudFlare DNS Service as a Dynamic DNS Provider (DDNS).
Image Tag | Architecture | OS | Size |
---|---|---|---|
latest | x64 | Alpine Linux | |
armhf | arm32v6 | Alpine Linux | |
aarch64 | arm64 | Alpine Linux |
Quick Setup:
docker run \
-e [email protected] \
-e API_KEY=xxxxxxx \
-e ZONE=example.com \
-e SUBDOMAIN=subdomain \
oznu/cloudflare-ddns
This image will also run on a Raspberry Pi or other ARM based boards that support Docker using the armhf
or aarch64
tags:
docker run \
-e [email protected] \
-e API_KEY=xxxxxxx \
-e ZONE=example.com \
-e SUBDOMAIN=subdomain \
oznu/cloudflare-ddns:armhf
--restart=always
- ensure the container restarts automatically after host reboot.-e EMAIL
- Your CloudFlare email address. Required-e API_KEY
- Your CloudFlare API Key. Get it here: https://www.cloudflare.com/a/profile. Required-e ZONE
- The DNS zone that DDNS updates should be applied to. Required-e SUBDOMAIN
- A subdomain of theZONE
to write DNS changes to. If this is not supplied the root zone will be used.-e PROXIED
- Set totrue
to make traffic go through the CloudFlare CDN. Defaults tofalse
.-e RRTYPE=A
- Set toAAAA
to use set IPv6 records instead of IPv4 records. Defaults toA
for IPv4 records.-e DELETE_ON_STOP
- Set totrue
to have the dns record deleted when the container is stopped. Defaults tofalse
.-e PROXY_IP
- IP address of proxy server API.-e ADMIN_NAME
- Log in name for proxy server API.-e ADMIN_PASSWORD
- Log in password for proxy server API.
If you need multiple records pointing to your public IP address you can create CNAME records in CloudFlare.
If you're wanting to set IPv6 records set the envrionment variable RRTYPE=AAAA
. You will also need to run docker with IPv6 support, or run the container with host networking enabled.
If you prefer to use Docker Compose:
version: '2'
services:
cloudflare-ddns:
image: oznu/cloudflare-ddns:latest # change 'latest' to 'armhf' or 'aarch64' if running on an arm device
restart: always
environment:
- [email protected]
- API_KEY=xxxxxxx
- ZONE=example.com
- SUBDOMAIN=subdomain
- PROXIED=false