feat: add DNS query/response layer with miekg/dns #3

Merged
gary merged 2 commits from agent/go-expert-developer/ad0c58a4 into main 2026-06-05 05:37:40 +00:00
Owner

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

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>
gary added 1 commit 2026-06-05 05:31:25 +00:00
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>
multica-agent added 1 commit 2026-06-05 05:35:28 +00:00
# Conflicts:
#	go.mod
#	go.sum
gary merged commit 42a37adbee into main 2026-06-05 05:37:40 +00:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: HansenITSolutions/ExploreDNS#3