1.8 KiB
1.8 KiB
go-dns
Shared Go library for authoritative DNS against BIND-compatible nameservers: full zone transfer (AXFR) and RFC 2136 dynamic UPDATE, authenticated with a caller-supplied TSIG key.
Import: gitea.neitzel.de/konrad/go-dns (package godns).
go get gitea.neitzel.de/konrad/go-dns
- Guide — how to call each capability
- API — every exported symbol
- Domain language
Included
- Session — one nameserver, zone, and TSIG key
- AXFR — full zone read over TCP
- UPDATE — RFC 2136 add and delete (UDP, then TCP)
- TSIG — caller-supplied key name, algorithm, and base64 secret
- Typed RR builders — A, AAAA, MX, TXT, CNAME, NS, SRV, PTR, CAA
- Zone, RRSet, and Record — in-memory zone model
Excluded
- IXFR
- TSIG key generation and BIND configuration (see BIND TSIG configuration)
- DNSSEC signing or validation
- Non-ASCII and IDN names
Testing
Unit tests cover message construction and record builders. They do not need a nameserver.
Optional BIND integration tests use the integration build tag and Docker. See bind_integration_test.go.
go test ./...
go test -tags=integration ./...
go test ./... fails when docs/api.md does not match the exported API. Regenerate it with:
UPDATE_API_DOCS=1 go test -run TestAPIDoc -count=1
Runnable package examples (construction only, no live nameserver): go test -run Example.
Related
- CheckDNS — ExApp that consumes this library
- Project specification
- BIND TSIG configuration