• This repository has been archived on 24/Aug/2022
  • Stars
    star
    1,039
  • Rank 43,240 (Top 0.9 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created almost 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A small amd64/ARM/ARM64 Docker image that allows you to use CloudFlare as a DDNS / DynDNS Provider.

Travis Docker Pulls

Docker CloudFlare DDNS

This small Alpine Linux based Docker image will allow you to use the free CloudFlare DNS Service as a Dynamic DNS Provider (DDNS).

This is a multi-arch image and will run on amd64, aarch64, and armhf devices, including the Raspberry Pi.

Image Variants

Image Tag Architecture OS Size
latest x64 Alpine Linux
armhf arm32v6 Alpine Linux
aarch64 arm64 Alpine Linux

Usage

Quick Setup:

docker run \
  -e API_KEY=xxxxxxx \
  -e ZONE=example.com \
  -e SUBDOMAIN=subdomain \
  oznu/cloudflare-ddns

Parameters

  • --restart=always - ensure the container restarts automatically after host reboot.
  • -e API_KEY - Your CloudFlare scoped API token. See the Creating a Cloudflare API token below. Required
    • API_KEY_FILE - Path to load your CloudFlare scoped API token from (e.g. a Docker secret). If both API_KEY_FILE and API_KEY are specified, API_KEY_FILE takes precedence.
  • -e ZONE - The DNS zone that DDNS updates should be applied to. Required
    • ZONE_FILE - Path to load your CloudFlare DNS Zone from (e.g. a Docker secret). If both ZONE_FILE and ZONE are specified, ZONE_FILE takes precedence.
  • -e SUBDOMAIN - A subdomain of the ZONE to write DNS changes to. If this is not supplied the root zone will be used.
    • SUBDOMAIN_FILE - Path to load your CloudFlare DNS Subdomain from (e.g. a Docker secret). If both SUBDOMAIN_FILE and SUBDOMAIN are specified, SUBDOMAIN_FILE takes precedence.

Optional Parameters

  • -e PROXIED - Set to true to make traffic go through the CloudFlare CDN. Defaults to false.
  • -e RRTYPE=A - Set to AAAA to use set IPv6 records instead of IPv4 records. Defaults to A for IPv4 records.
  • -e DELETE_ON_STOP - Set to true to have the dns record deleted when the container is stopped. Defaults to false.
  • -e INTERFACE=tun0 - Set to tun0 to have the IP pulled from a network interface named tun0. If this is not supplied the public IP will be used instead. Requires --network host run argument.
  • -e CUSTOM_LOOKUP_CMD="echo '1.1.1.1'" - Set to any shell command to run them and have the IP pulled from the standard output. Leave unset to use default IP address detection methods.
  • -e DNS_SERVER=10.0.0.2 - Set to the IP address of the DNS server you would like to use. Defaults to 1.1.1.1 otherwise.
  • -e CRON="@daily" - Set your own custom CRON value before the exec portion. Defaults to every 5 minutes - */5 * * * *.

Depreciated Parameters

  • -e EMAIL - Your CloudFlare email address when using an Account-level token. This variable MUST NOT be set when using a scoped API token.

Creating a Cloudflare API token

To create a CloudFlare API token for your DNS zone go to https://dash.cloudflare.com/profile/api-tokens and follow these steps:

  1. Click Create Token
  2. Provide the token a name, for example, cloudflare-ddns
  3. Grant the token the following permissions:
    • Zone - Zone Settings - Read
    • Zone - Zone - Read
    • Zone - DNS - Edit
  4. Set the zone resources to:
    • Include - All zones
  5. Complete the wizard and copy the generated token into the API_KEY variable for the container

Multiple Domains

If you need multiple records pointing to your public IP address you can create CNAME records in CloudFlare.

IPv6

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.

Docker Compose

If you prefer to use Docker Compose:

version: '2'
services:
  cloudflare-ddns:
    image: oznu/cloudflare-ddns:latest
    restart: always
    environment:
      - API_KEY=xxxxxxx
      - ZONE=example.com
      - SUBDOMAIN=subdomain
      - PROXIED=false

License

Copyright (C) 2017-2020 oznu

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

More Repositories

1

docker-guacamole

A self-contained guacamole docker container for x64 and ARM. Remotely connect over SSH, RDP or VNC using HTML5.
Dockerfile
526
star
2

homebridge-gsh

Allow Google Assistant to control your Homebridge accessories.
TypeScript
394
star
3

dns-zone-blacklist

This project generates dnsmasq, bind and unbound zone files to be used in DNS based AD Blockers.
JavaScript
170
star
4

docker-unms

This image is no longer maintained: https://github.com/oznu/docker-unms/issues/53
Dockerfile
143
star
5

docker-dns-ad-blocker

A lightweight dnsmasq DNS server to block traffic to known ad servers with optional DNSCrypt support. Supports x86_64 and Raspberry Pi (armhf).
Dockerfile
80
star
6

homebridge-unifi-occupancy-sensor

An occupancy sensor for Homebridge and UniFi
JavaScript
69
star
7

unifi-events

A Node.js module to listen for events from a UniFi Controller.
JavaScript
53
star
8

docker-onedrive-sync

A docker container to sync data between a mounted volume and OneDrive Personal/Business.
Shell
42
star
9

homebridge-daikin-esp8266

An Arduino Sketch and Homebridge Plugin to control my Daikin AC using an ESP8266 micro controller.
TypeScript
33
star
10

docker-s6-alpine

Alpine Linux + S6 Overlay
Dockerfile
30
star
11

alpine-node

Node.js binaries for Alpine Linux on x86_64, armhf and aarch64.
Dockerfile
20
star
12

pycpanel

A python module for the cPanel API
Python
18
star
13

homebridge

HomeKit support for the impatient
JavaScript
11
star
14

docker-cloud9

Work in progress
JavaScript
8
star
15

mdns-resolver

A node.js module to resolve zeroconf .local domains using pure JavaScript.
TypeScript
7
star
16

pyHyperV

Simple client for calling the HyperV orchestrator runbooks in python. Not maintained.
Python
6
star
17

ws-connect

WebSocket client for Node.js that transparently reconnects lost or disconnected connections.
TypeScript
6
star
18

homekit-daikin-ir-thermostat

No longer used. Replaced with Daikin ESP8266 Arduino Project
JavaScript
6
star
19

homebridge-esp8266-fan

A Homebridge plugin and ESP8266 Arduino sketch to control a 3 speed fan using a 4 channel relay.
C++
6
star
20

esp-irrigation-controller

An ESP32 powered irrigation system controller with HomeKit support powered by Homebridge.
TypeScript
6
star
21

docker-s6-alpine-node

Alpine/Ubuntu Linux + S6 Overlay + Node
Dockerfile
5
star
22

paAPI

A python client for the Parallels Operations Automation and Parallels Business Automation Enterprise APIs.
Python
4
star
23

homebridge-esp8266-garage-door

An esp8266 powered garage door controller with HomeKit support powered by Homebridge.
C++
3
star
24

homebridge-esp-pir

A Homebridge plugin and ESP8266 Arduino sketch for a PIR sensor.
TypeScript
3
star
25

gh-wiki-edit-discord-notification

GitHub Action to notify a Discord channel when someone edits the project wiki.
JavaScript
2
star
26

homebridge-esp8266-outlet

C++
1
star
27

recently-closed-tabs-crx

Recently Closed Tabs extension for Google Chrome
JavaScript
1
star
28

docker-s6-debian

Debian Slim + S6 Overlay
1
star