Documentation
¶
Overview ¶
Package xfr implements DNS zone transfer (AXFR/IXFR) clients over TLS (RFC 9103) and plain TCP (RFC 5936).
AXFR (RFC 5936) transfers a complete zone as a stream of DNS messages. The client sends a single AXFR query, and the server responds with one or more DNS messages containing the zone's resource records. The first message begins with the zone's SOA record, and the last message ends with the same SOA record.
XFR-over-TLS (RFC 9103) mandates TLS 1.3 on port 853, reusing the DNS-over-TLS (DoT) transport. Plain TCP on port 53 is supported for legacy compatibility.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AXFR ¶
func AXFR(ctx context.Context, cfg ClientConfig) ([]dns.ResourceRecord, error)
AXFR performs a full zone transfer (AXFR) and returns all resource records in the zone. The transfer uses the configured transport (TLS or plain TCP).
Types ¶
type ClientConfig ¶
type ClientConfig struct {
// PrimaryAddr is the address of the primary DNS server from which
// to transfer the zone, e.g. "10.0.0.1:853" or "ns1.example.com".
// If empty, ":853" is assumed and the zone name is used to look up
// the primary server via DNS (not implemented yet).
PrimaryAddr string
// Zone is the name of the zone to transfer, e.g. "example.com".
Zone string
// Timeout is the per-message read/write deadline.
Timeout time.Duration
// UseTLS enables TLS transport (RFC 9103). When true, the client
// connects via TLS to the primary on port 853. When false, plain
// TCP on port 53 is used (RFC 5936).
UseTLS bool
// InsecureSkipVerify controls whether TLS certificate verification
// is skipped. Should only be used for testing.
InsecureSkipVerify bool
}
ClientConfig configures an XFR client.