Commit Graph
2 Commits
Author SHA1 Message Date
Garyandmultica-agent 2835ee86cf feat: implement Phase 2.3 DNS traversal engine
CI / test (pull_request) Failing after 2m40s
Add core traversal engine with iterative resolution from root servers:
- referral.go: Referral struct with name, type, bailiwick, addresses, state
- cache.go: Chained InfoCache with parent inheritance for NS and glue records
- stack.go: LIFO stack with configurable max depth enforcement
- response.go: Response classifier (referral, answer, CNAME follow, NODATA,
  NXDOMAIN, SERVFAIL) with child referral generation and probability splitting
- traverser.go: Traverser orchestrates full traversal from root to leaf,
  following all referral branches, handling CNAME chains, and respecting
  max depth limits

Add IterativeQuery/IterativeQueryWithExchange to dns package (RD=false queries).

57 new tests covering all acceptance criteria: traversal from root to leaf,
comprehensive branch following, max depth enforcement, probability distribution,
chained cache behavior, CNAME following, NXDOMAIN/SERVFAIL handling, context
cancellation, and concurrent access.

Co-authored-by: multica-agent <github@multica.ai>
2026-06-06 13:23:01 +10:00
Garyandmultica-agent fce7920611 feat: add DNS query/response layer with miekg/dns
Phase 1.2 implementation:

- internal/dns/types.go: DNS record type constants (A, AAAA, NS, CNAME, SOA,
  MX, TXT, SRV, PTR, ANY) with QNameType helper and EDNS0 defaults
- internal/dns/query.go: Query/QueryWithExchange with UDP, configurable
  EDNS0 buffer size, TCP fallback on truncation, always-TCP mode, configurable
  retries with timeout, context support, and injectable ExchangeFunc for testing
- internal/dns/decode.go: Response classification (answer, referral, NODATA,
  NXDOMAIN, SERVFAIL), CNAME chain extraction with dedup, truncation/RCODE
  detection, and section extraction utilities

32 unit tests covering all acceptance criteria.

Co-authored-by: multica-agent <github@multica.ai>
2026-06-05 15:14:56 +10:00