**Snap DynDNS Server** is a tiny Dynamic DNS service for domains managed by the registrar InterNetworX (inwx.de). It is a single Python CGI script without dependencies beyond the standard library, made for shared hosting such as Uberspace.
The server is a credential broker: your INWX API login only exists on the server, while each device gets its own random token that can update exactly one hostname. A device that gets lost or compromised can be cut off by deleting one section from the config.
It speaks the common dyndns2 protocol (HTTP Basic Auth, `myip`/`myipv6`, `good`/`nochg` answers), so routers like the AVM FritzBox, ddclient, and plain `curl` work. The matching client is [Snap DynDNS client](https://src.mehl.mx/mxmehl/snap-dyndns-client), a small shell script for cron.
1. A device sends `GET /update.cgi` with its hostname and token as Basic Auth. Without `myip`/`myipv6`, the server uses the IP the request came from.
2. The server compares the SHA-256 of the token with the config.
3. If the IP equals the last one it stored, it answers `nochg` right away. INWX is not contacted, so polling every minute is cheap.
4. Otherwise it logs in to INWX, looks up the record by name and type, updates it, and only then stores the new IP. If INWX fails, the device gets `911` and retries on its next run.
The record (A and/or AAAA) has to exist at INWX already. The server picks A or AAAA depending on the IP family, and keeps the TTL you set there.
- Apache with CGI and `.htaccess` support (Uberspace 7 has both)
- Python 3.11 or newer, no packages needed
- An INWX account or API sub-account. If 2FA is enabled, the TOTP shared secret is needed as well. IP-restricted API accounts work if the server's IP is allowed.
The `.htaccess` in the repository enables CGI, passes the `Authorization` header to the script, and denies access to every file except `update.cgi`. If your Python is not at `/usr/bin/python3.14`, adjust the shebang of `update.cgi`.
If you prefer another location, uncomment `SetEnv SNAP_DYNDNS_CONFIG` in `.htaccess`. The state file with the last known IPs is written next to the config (`state_file` in the config).
The hostname is the Basic Auth user name, the token the password. The INWX zone is guessed as the last two labels of the hostname. For zones such as `example.co.uk` set `zone = "example.co.uk"` in that section.
The tests use a fake INWX server. An additional smoke test runs against the INWX OT&E test system and is skipped unless `INWX_OTE_USER`, `INWX_OTE_PASS` and `INWX_OTE_HOST` (an existing A record in that account) are set in the environment. It restores the record afterwards.