Giter Club home page Giter Club logo

dockdns's Introduction

DockDNS - (Dynamic) DNS Client based on Docker Labels

DockDNS is a DNS updater, which supports configuring DNS records through Docker labels. Currently DockDNS only supports Cloudflare as a DNS provider.

Features

  • Dynamic DNS updates
  • Static DNS entries (e.g. with a static IP address)
  • Static DNS record configuration based on a config file
  • Dynamic DNS record configuration based on Docker labels
  • IPv4 & IPv6 support
  • Supports multiple zones

Configuration

The app configuration as well as the static domain entries are read from a configuration file (see example configuration).

interval: 600 # Optional, the update interval in seconds. Defaults to 600

webUI: false # Optional, enables a WebUI (port 8080) that lists the scanned domains and current settings. Defaults to false

log:
  level: debug # Optional, Log level, one of 'debug', 'info', 'warn' or 'error'. Defaults to 'info'
  format: simple # Optional, output of the log format, 'simple' or 'json'. Defaults to 'simple'

zones: # Zone configuration (multiple zones can be provided)
  - name: somedomain.com # Root name of the zone
    provider: cloudflare # Name of the provider. Currently only Cloudflare is supported
    apiToken: ... # API Token, needs permission 'Zone.Zone' (read) and Zone.DNS (edit)
    zoneID: ... # ZoneID of this zone

dns:
  a: true # Update IPv4 addresses
  aaaa: false # Update IPv6 addresses
  defaultTTL: 300 # Optional, default TTL for all records. Defaults to 300
  purgeUnknown: true # Optional, delete unknown records. Defaults to false.

# Static domain configuration (optional)
domains:
  - name: "*.somedomain.com"

  - name: "somedomain.com"
    a: 10.0.0.2
    aaaa: ::1

Dynamic Domains

Domains can also be configured using Docker labels. Supported labels:

Label Example
dockdns.name dockdns.name=somedomain.com
dockdns.a dockdns.a=127.0.0.1
dockdns.aaaa dockdns.aaaa=::1
dockdns.ttl dockdns.ttl=600
dockdns.proxied dockdns.proxied=false

If no explicit IP address is set, the public IP will be fetched and set automatically (DynDNS).

Installation

Go install

go install github.com/Tarow/dockdns@latest

By default, DockDNS looks for a config.yaml in the current folder. The location of the configuration file can be overwritten using the -config flag:

dockdns -config /path/to/config.yaml

Docker

docker run -v ./config.yaml:/app/config.yaml -v /var/run/docker.sock:/var/run/docker.sock:ro ghcr.io/tarow/dockdns:latest

Docker Compose

version: "3.7"

services:
  dockdns:
    image: ghcr.io/tarow/dockdns:latest
    restart: unless-stopped
    volumes:
      - ./config.yaml:/app/config.yaml
      - /var/run/docker.sock:/var/run/docker.sock:ro

dockdns's People

Contributors

tarow avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.