2026-09-30 17:29:54 +02:00
2026-09-20 17:16:16 +02:00

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

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.

S
Description
DNS Library for go
Readme
117 KiB
Languages
Go 100%