docs: comprehensive documentation for HAN-387
CI / test (pull_request) Failing after 1m19s

- README.md: full project overview, installation, quick start, CLI reference,
  output format descriptions, architecture overview, and dnstraverse comparison
- GoDoc: package-level documentation for traverse, dns, config, output, and
  fingerprint packages
- GoDoc: TraverserConfig and TraversalResult type comments in traverser.go

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
Gary Hansen
2026-06-08 04:05:15 +10:00
co-authored by Copilot multica-agent
parent e6e07941a5
commit ee20ed51f6
7 changed files with 283 additions and 19 deletions
+26
View File
@@ -1 +1,27 @@
// Package traverse implements the core DNS traversal engine for ExploreDNS.
//
// The traversal engine starts from the DNS root servers and iteratively
// follows every referral it receives, building a complete picture of the
// delegation path for a domain. Unlike a standard recursive resolver, which
// stops at the first authoritative answer, the traversal engine explores every
// branch so that delegation mismatches, lame delegations, or split authorities
// are all visible in the output.
//
// # Architecture
//
// A Traverser maintains a stack of Referral objects. Each Referral
// represents a pending query to a specific set of nameservers for a specific
// name and record type. The engine pops referrals one at a time, sends the
// query, classifies the response, and pushes any child referrals back onto the
// stack.
//
// When a referral contains nameserver names but no glue records (IP addresses),
// the engine resolves them via a secondary traversal before continuing.
//
// # Caching
//
// An InfoCache stores discovered glue records. In fast mode (default) a
// single root cache is shared across all branches so that glue discovered in
// one branch is immediately available to sibling branches. Disable fast mode
// (TraverserConfig.Fast = false) for fully independent branch resolution.
package traverse
+11
View File
@@ -11,12 +11,20 @@ import (
miekgdns "github.com/miekg/dns"
)
// TraverserConfig configures the behaviour of a Traverser.
type TraverserConfig struct {
// MaxDepth is the maximum referral depth before the traversal gives up.
MaxDepth int
// QueryType is the DNS record type to query (e.g. dns.TypeA).
QueryType uint16
// RootConfig controls how root servers are discovered.
RootConfig *dns.RootDiscoveryConfig
// QueryConfig controls per-query transport parameters.
QueryConfig *dns.QueryConfig
// RootAddrs is an optional pre-seeded list of root server IP addresses.
// When non-empty, root discovery via RootConfig is skipped.
RootAddrs []net.IP
// Hooks provides optional callbacks for traversal events.
Hooks *TraverserHooks
// Fast controls cache sharing across branches. When true (default), child
// branches inherit glue discovered by earlier branches via the shared root
@@ -37,11 +45,14 @@ func DefaultTraverserConfig() *TraverserConfig {
}
}
// TraversalResult pairs a Referral with the Response received when it was processed.
type TraversalResult struct {
Referral *Referral
Response *Response
}
// Traverser performs an exhaustive iterative DNS traversal starting from the
// root servers. Create one via NewTraverser and call Traverse to start a run.
type Traverser struct {
config *TraverserConfig
exchange dns.ExchangeFunc