*Ma*nage *ma*naged *DNS* services with this tool.
Schlundtech and probably soon, also Hetzner Cloud DNS too.
|
|
hace 1 semana | |
|---|---|---|
| .opencode | hace 1 semana | |
| cmd | hace 1 semana | |
| internal | hace 1 semana | |
| maister @ 65459dcf65 | hace 1 semana | |
| scripts | hace 1 semana | |
| tools | hace 1 semana | |
| .env.example | hace 1 semana | |
| .gitignore | hace 1 semana | |
| .gitmodules | hace 1 semana | |
| AGENTS.md | hace 1 semana | |
| README.md | hace 1 semana | |
| go.mod | hace 1 semana | |
| go.sum | hace 1 semana | |
| main.go | hace 1 semana | |
| opencode.json | hace 1 semana |
A command line tool for Schlundtech DNS. List your zones, inspect their records, and set them — from the terminal, no web interface.
On the machine you develop on:
go build
./schlundtech-dns --help
Or skip the binary entirely:
go run . --help
Use
go build, notgo build ./.... With more than one package the...form only compiles and writes nothing.
No toolchain on the target needed — the binary is pure Go and statically linked, so it runs on any Linux without a libc:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w" \
-o dist/schlundtech-dns-linux-amd64 .
GOARCH=arm64 gives you dist/schlundtech-dns-linux-arm64. Copy the file over
and run it:
./schlundtech-dns-linux-amd64 --help
Copy the example file and fill it in:
cp .env.example .env
chmod 600 .env
$EDITOR .env
SCHLUNDTECH_USER=your-user
SCHLUNDTECH_PASSWORD=your-password
SCHLUNDTECH_CONTEXT=10
Check that it works:
./schlundtech-dns zones
.env is read from the working directory. It is gitignored, and the tool warns
if it is readable by other users.
Real environment variables win over .env, so you can redirect a single
invocation without editing the file:
SCHLUNDTECH_CONTEXT=1 ./schlundtech-dns zones
SCHLUNDTECH_CONTEXT is the context ID Schlundtech gave you when you applied
for gateway access. Every public implementation for Schlundtech uses 10, so
that is the value to try first — but yours is authoritative. The demo system
uses 1.
SCHLUNDTECH_TOKEN — only if your account has two-factor authentication:
the current six-digit code from your authenticator app. It is valid for about
30 seconds, so set it right before you run the command.
SCHLUNDTECH_ENDPOINT — to talk to the demo system instead of your live
zones: https://demo.autodns.com/gateway/.
schlundtech-dns zones
schlundtech-dns records list example.com
schlundtech-dns records list example.com --type TXT
schlundtech-dns records set example.com --name @ --type A --value 203.0.113.10
schlundtech-dns records set example.com --name @ --type TXT --value 'v=spf1 -all'
@ is the zone apex, www would be www.example.com. --ttl defaults to the
TTL the record already has.
A name and type can hold several values — pass --value more than once. Setting
any value replaces all existing ones for that name and type, so there is
nothing to delete first.
Every write touches public DNS and propagates within seconds. Preview first:
schlundtech-dns records set example.com --name @ --type A --value 203.0.113.10 --dry-run
Without --value this removes every value at that name and type:
schlundtech-dns records delete example.com --name @ --type TXT --value 'v=spf1 -all' --dry-run
schlundtech-dns records delete example.com --name @ --type TXT --value 'v=spf1 -all'
Every command takes --output table|json. table is the default.
schlundtech-dns records list example.com --output json | jq '.[].value'
Errors always go to stderr, so piping stdout stays clean.
There is no hardcoded list — --type takes whatever the gateway understands.
TXT, A, AAAA, CNAME, MX and the rest all work the same way.
Two notes:
NS and SOA are not worth touching. Changing them breaks zone delegation.MX is managed by Schlundtech alongside their mail routing. Editing it by
hand can break mail delivery for the domain.The gateway is InterNetX's AutoDNS XML API, reached at
gateway.schlundtech.de. Two things are worth knowing if you read the code:
The gateway allows three requests per second; the tool spaces its calls out accordingly.