LookupNS(ctx, domain) — trace delegation chain for authoritative NSes
LookupAllRecords(ctx, hostname) — query each authoritative NS independently for A, AAAA, CNAME, MX, TXT, SRV, CAA, NS. Return map[nameserver]map[recordType][]string
ResolveIPAddresses(ctx, hostname) — resolve to all IPs following CNAME chains (depth limit 10)
Use github.com/miekg/dns for wire protocol
Timeouts, retries (2 per query), SERVFAIL/REFUSED/NXDOMAIN handling
UDP with TCP fallback for truncated responses
Thread-safe
Approach
TDD: write tests first, commit, then implement
Tests use real DNS against example.com, google.com
Run make check before commits
## Plan
Implement the iterative DNS resolution engine in `internal/resolver/resolver.go`.
### Requirements
1. Hardcode IANA root nameserver IPs (IPv4+IPv6) with periodic refresh
2. Iterative resolution: root → TLD → domain → authoritative
3. `LookupNS(ctx, domain)` — trace delegation chain for authoritative NSes
4. `LookupAllRecords(ctx, hostname)` — query each authoritative NS independently for A, AAAA, CNAME, MX, TXT, SRV, CAA, NS. Return `map[nameserver]map[recordType][]string`
5. `ResolveIPAddresses(ctx, hostname)` — resolve to all IPs following CNAME chains (depth limit 10)
6. Use `github.com/miekg/dns` for wire protocol
7. Timeouts, retries (2 per query), SERVFAIL/REFUSED/NXDOMAIN handling
8. UDP with TCP fallback for truncated responses
9. Thread-safe
### Approach
- TDD: write tests first, commit, then implement
- Tests use real DNS against example.com, google.com
- Run `make check` before commits
sneak
was assigned by clawbot2026-02-19 22:42:18 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Plan
Implement the iterative DNS resolution engine in
internal/resolver/resolver.go.Requirements
LookupNS(ctx, domain)— trace delegation chain for authoritative NSesLookupAllRecords(ctx, hostname)— query each authoritative NS independently for A, AAAA, CNAME, MX, TXT, SRV, CAA, NS. Returnmap[nameserver]map[recordType][]stringResolveIPAddresses(ctx, hostname)— resolve to all IPs following CNAME chains (depth limit 10)github.com/miekg/dnsfor wire protocolApproach
make checkbefore commits