dockdns

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
api
dns
ip
templ: version: 0.2.476
templ: version: 0.2.476
components
templ: version: 0.2.476
templ: version: 0.2.476

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL