No description
  • Go 98.7%
  • Dockerfile 1.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-17 09:03:33 +01:00
deploy Initialise project 2.0 2026-11-15 15:07:39 +01:00
komodo Update komodo/dynrelay-procedure.toml 2026-11-16 22:24:02 +01:00
backend.go CloudDNS: treat every answer that is not a clear success as an error 2026-11-17 08:46:58 +01:00
config.go Harden lockout logging, MIN_UPDATE_INTERVAL and ntfy error logs 2026-11-17 08:46:58 +01:00
Dockerfile Update golang:1.27-alpine Docker digest to 70bd7dd 2026-11-16 08:01:15 +00:00
dynrelay_test.go Harden lockout logging, MIN_UPDATE_INTERVAL and ntfy error logs 2026-11-17 08:46:58 +01:00
go.mod Require LISTEN, refuse router updates without IPV6_SUFFIX 2026-11-16 16:10:21 +01:00
ip.go Initialise project 2.0 2026-11-15 15:07:39 +01:00
LICENSE Initialise project 2.0 2026-11-15 15:07:39 +01:00
main.go Require LISTEN, refuse router updates without IPV6_SUFFIX 2026-11-16 16:10:21 +01:00
README.md README: warn about Docker bridge clients, recommend ALLOWED_NETS 2026-11-17 08:46:58 +01:00
renovate.json Initialise project 2.0 2026-11-15 15:07:39 +01:00
server.go Harden lockout logging, MIN_UPDATE_INTERVAL and ntfy error logs 2026-11-17 08:46:58 +01:00

dynrelay

A small, locked-down dynDNS relay for netcup DNS. Your router (or any dyndns2 client) calls it on the LAN, it checks the request strictly and then moves exactly one pre-configured A/AAAA record at netcup.

Status: proof of concept. The request handling is covered by tests against a fake netcup server. Neither netcup backend has been run against a real netcup account yet; do that first with dynrelay check (read-only).

Credit

dynrelay is the successor to ownDynDNS by Felix Kretschmer (@fernwerker), Philipp Tempel (@philipptempel) and Branko Wilhelm (@b2un0), and keeps its idea: a self-hosted endpoint that turns a router's dynDNS call into a netcup DNS API update. The code is a new implementation in Go; like ownDynDNS it is published under the GNU General Public License v3.0 (see LICENSE).

What changed compared to ownDynDNS

ownDynDNS dynrelay
Any hostname in the request is updated Only hostnames listed in HOSTS, each with its zone stated
.env and log.json in the web root No web root; secrets from files, logs to stdout
Password in the URL HTTP Basic auth only; credentials in the URL are refused
Unlimited password guesses Client IP allowlist, then lockout after 5 failures in 10 minutes
Any IP accepted Public addresses only, optional ALLOWED_NETS, ntfy message on every change and on failed updates
API errors ignored Every netcup answer is checked; failure is reported as 911
Whole record set sent back Only the changed record is sent
SOAP, PHP + web server JSON over HTTPS, one static binary, no third-party packages

Quick start

  1. Create the record once in the netcup panel (dynrelay never creates records), e.g. an AAAA record home in cammia.de.
  2. Create the token: docker run --rm <image> gen-token. The token goes into the router, the SHA-256 into your secrets.
  3. Copy deploy/compose.yaml and deploy/secrets.env.template to your stacks repository, fill in every CHANGEME and encrypt the secrets with sops.
  4. Test the netcup side without changing anything: docker compose run --rm dynrelay check
  5. docker compose up -d, then configure the router.

FRITZ!Box

Internet > Freigaben > DynDNS, provider "Benutzerdefiniert":

  • Update-URL: http://<lan-ip-of-server>:8080/nic/update?hostname=<domain>&myip=<ipaddr>&myipv6=<ip6addr>&ip6lanprefix=<ip6lanprefix>
  • Domainname: home.cammia.de
  • Benutzername: value of AUTH_USER
  • Kennwort: the token from gen-token

The placeholders in angle brackets after hostname= are filled in by the FRITZ!Box; only the server address is yours to change. User name and token are sent as an HTTP header, not in the URL.

IPv6-only connections (no public IPv4)

Set IP_FAMILIES: ipv6. Whatever the router sends as IPv4 (often a carrier NAT address) is then ignored.

With IPv6 the router's own address is usually not what you want in DNS: it sits in a different network than your LAN devices. Set IPV6_SUFFIX to the fixed host part (interface ID) of the machine the name should point to. dynrelay then builds the address from the LAN prefix the router announces (ip6lanprefix) plus that suffix. Find the suffix with ip -6 addr on that machine: it is the last four groups of its stable global address (not a "temporary" one).

If a request carries ip6lanprefix but IPV6_SUFFIX is not set, dynrelay refuses it (badip): the router's myipv6 is its own WAN address, which would otherwise end up in DNS. To publish the router's address on purpose, leave ip6lanprefix out of its update URL.

Note for allowlists that resolve this name: other machines in your home use other addresses inside the same /64, so an allowlist that should cover the whole home network must allow the /64 around the resolved address, not just the single address.

Configuration

Variable Required Meaning
LISTEN yes address:port to serve on, e.g. the host's LAN address. No default, so a forgotten value never means "all interfaces"; :8089 is accepted only when written out
HOSTS yes fqdn=zone, comma separated. The only names that can be updated
ALLOWED_CLIENTS yes Addresses/CIDRs allowed to call the service
AUTH_USER yes Basic auth user name
AUTH_TOKEN_SHA256 yes SHA-256 (hex) of the token, from gen-token
BACKEND yes netcup-legacy or netcup-clouddns
NETCUP_CUSTOMER, NETCUP_API_KEY, NETCUP_API_PASSWORD legacy netcup customer number and DNS API credentials
NETCUP_TOKEN clouddns netcup API token
IP_FAMILIES no ipv4,ipv6 (default), ipv6 or ipv4
IPV6_SUFFIX no Interface ID such as ::1234:56ff:fe78:9abc
ALLOWED_NETS no, recommended New addresses must be inside these ranges, e.g. your provider's prefix (see below)
MIN_UPDATE_INTERVAL no Minimum time between netcup calls per host, default 30s, at least 5s
NTFY_URL, NTFY_TOKEN no ntfy topic URL and access token for messages about changes and failed updates

Every secret can also be given as <NAME>_FILE pointing to a file. The service refuses to start if anything is missing or malformed.

Which backend? In the netcup panel open the domain: a CloudDNS tab means netcup-clouddns, a plain DNS tab means netcup-legacy.

Answers

good <ip> changed, nochg <ip> already correct, badauth (401), nohost (400), badip: <reason> (400), abuse (429, locked out or too frequent), 911 (502, netcup failed; see the log), forbidden (403, client not allowed).

Things to know

  • The netcup credential is valid for the whole account. Keep it on this host.
  • Check client in the log after the first router update. It must be the router's own address. If it shows a Docker bridge or gateway address (usually 172.17.0.1 or another 172.16.0.0/12 address), do not add that address to ALLOWED_CLIENTS: with a published port, every request from the LAN arrives from that address, so allowing it allows everyone. Use network_mode: host and set LISTEN to the LAN address instead of ports.
  • Plain HTTP: the token is readable to anyone who can sniff this LAN segment. ALLOWED_CLIENTS limits who could use it, and ALLOWED_NETS limits what a stolen token can do: set it to your provider's address range, and the record can only ever point into that range, never to a server of the attacker's choosing. This matters most if other systems trust the hostname, for example a firewall allowlist that resolves it. Your provider's range shows up in whois <your public address> (inet6num / inetnum). TLS is not built in yet.
  • Create the token with gen-token. dynrelay stores only an unsalted SHA-256 hash of it. For a long random token that is safe; a short or human-chosen one could be found from the hash by trying guesses offline, if the hash ever leaks (for example with a configuration backup).
  • Lockout: after 5 wrong passwords in 10 minutes a client is locked out for 15 minutes, and during that time even the right token is refused (so guessing gets no feedback). After fixing a wrong token in the router, wait out the lockout or restart dynrelay.
  • With NTFY_URL set, a failed netcup update sends a message right away; while it keeps failing, at most one per hour per host, and one more once it works again. Error logs never contain the ntfy topic URL.
  • State is in memory only. After a restart the first update reads the record from netcup again.

Repository layout

Path Content
*.go, go.mod The service and its tests (standard library only)
Dockerfile Multi-arch build: runs vet and tests, then a static binary on distroless
deploy/ Example compose file and secrets template (placeholders only)
komodo/ Komodo Build definition for the Raspberry Pi 5 builder and setup steps
renovate.json Keeps base image digests and the Go version current

Development

go vet ./... && go test -race ./...
docker build -t dynrelay .