Dynamic DNS daemon in Go with a pluggable retriever/provider architecture
3.2K
Keep your DNS records pointed at your home or server IP, even when your ISP changes it.
dnspatch is a dynamic DNS daemon in Go. It watches your public IPv4 and IPv6 address and updates your DNS records when it changes. It is a single static binary or a container image of a few megabytes, with no runtime dependencies.
Documentation · Config builder · Releases · Docker Hub · GitHub Container Registry · API reference · Issues
A and AAAA records are handled independently.${ENV} substitution and ${file:...} for Docker and Kubernetes secrets.Versioning. dnspatch follows semantic versioning and is in the
v0.xseries on purpose: the plugin contract has not been proven by many plugins yet. Untilv1.0.0, a minor release may change the public API of theplugin,httpxandapppackages and the configuration format; patch releases will not. Breaking changes are called out in the release notes and described in the migration guides. Pin the version you tested.
Prefer a form to a text editor? The online builder assembles dnspatch.toml and tells you which image or build tags you need.
Create dnspatch.toml. This keeps home.example.com on Cloudflare pointed at your current public IP:
[[instance]]
name = "home"
[[instance.retriever]]
type = "ipify"
[[instance.provider]]
type = "cloudflare"
zone_id = "YOUR_ZONE_ID"
zone = "example.com"
rr_name = "home"
token = "${CF_TOKEN}" # read from the environment
Put the secret in .env, which stays out of the config file:
CF_TOKEN=your-api-token-scoped-to-Zone-DNS-Edit
Create compose.yml next to them:
services:
dnspatch:
image: krimsn/dnspatch:latest
restart: unless-stopped
env_file: .env
volumes:
- ./dnspatch.toml:/etc/dnspatch/config.toml:ro
Run it:
docker compose up -d
dnspatch --check-config validates the file without starting the daemon. Ready-made configs for dual-stack, fallback between retrievers, several providers, proxies, secrets from files and your own name server are in examples/. The compose.yml in the repository root is a fuller version with log rotation and a read-only filesystem.
Binary for Linux, macOS and Windows from the releases page.
Container image from Docker Hub (krimsn/dnspatch) or the GitHub Container Registry (ghcr.io/dnspatch/dnspatch). The latest-full tag adds the notifiers and the rfc2136, yandexcloud and namecheap providers.
From source, with Go 1.27 or newer:
go install github.com/dnspatch/dnspatch/cmd/dnspatch@latest
This builds the lightweight version: without the notifiers (Redis, RabbitMQ, MQTT) and without the rfc2136, yandexcloud and namecheap providers. To get them, add the full build tag, or the tag of just the plugin you need:
go install -tags full github.com/dnspatch/dnspatch/cmd/dnspatch@latest
Docker Compose, build tags for a smaller binary and cross-compiling are in the installation guide. Not sure which build or tags you need? The builder picks them from the plugins in your config.
| Provider | Records | Notes |
|---|---|---|
| Cloudflare | A, AAAA | API token scoped to one zone, optional proxying |
| DuckDNS | A, AAAA | |
| No-IP, Dyn, Dynu | A, AAAA | dyndns2-based |
| Namecheap | A | IPv4 only |
dyndns2 | A, AAAA | any service that speaks the dyndns2 protocol |
rfc2136 | A, AAAA | your own BIND, Knot, PowerDNS, Technitium; TSIG-signed |
| REG.RU, NIC.RU, Selectel, Timeweb Cloud, Yandex Cloud DNS, Beget | A, AAAA |
The full list with every parameter is in the parameter reference. Your provider isn't there? Use dyndns2 if it speaks that protocol, or write a plugin.
The full documentation is at dnspatch.github.io/dnspatch:
Ready-made configs for specific scenarios are in examples/.
Bug reports and ideas go to GitHub Issues. CONTRIBUTING.md covers commit messages and pull requests; the documentation sources are in docs/.
MIT — see LICENSE.
Content type
Image
Digest
sha256:0bbff2e96…
Size
4.2 MB
Last updated
15 days ago
docker pull krimsn/dnspatch