Skip to content

Support NS, MX and TXT record types with a dangling-NS takeover hint #194

Closed

Description

@TMHSDigital

Summary

Only A, AAAA and CNAME are supported. A delegated subzone whose NS points at an unregistered nameserver is a classic takeover that CNAME-only scanning misses; the standard library already offers LookupNS, LookupMX and LookupTXT.

Where

  • internal/dns/resolver.go:28 (supportedTypes), :105 (error text), :253 (queriesPerType)
  • docs/ROADMAP.md "Known limitations" (test server models only A/AAAA/CNAME)

Proposal

Add NS first, with a dangling-ns takeover hint when the NS host is NXDOMAIN, then MX and TXT. Extend internal/dnstest replies and the lab dnsserver accordingly. Extend queriesPerType so -rate stays exact and add SARIF rule ids for the new hint.

Who benefits

Takeover hunters and monitoring users; complements the CNAME fingerprint work in #134.

Open questions

  • Whether NS lookups should be on by default or only with -type NS

Acceptance criteria

  • -type NS resolves and reports NS records
  • Dangling NS produces a takeover hint and a SARIF result
  • Lab zone and tests cover it

Getting started

  • Relevant files: internal/dns/resolver.go, internal/dns/takeover.go, internal/dnstest, internal/dnsserver/server.go, internal/output/sarif.go
  • How to run tests: go test ./internal/...
  • Related docs: README (-type), docs/labs.md

Related: #134


Filed by repo-audit/full-audit at 3139c44. Severity: medium. Effort: M. audit-key: enhancement|internal/dns/resolver.go|record-types-ns-mx-txt

Activity

  1. added
    enhancement
    help wanted
    area: dns
    severity: medium
    on Nov 9, 2026
  2. TMHSDigital commented on Nov 11, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in ffcdc8d.

    • -type now takes NS, MX and TXT, at one query each under -rate.
      • MX values read <preference> <host>.
      • With NS, a delegation whose name server returns NXDOMAIN gets a dangling-ns takeover hint. -sarif reports it under a subenum/dangling-ns rule.
    • The test DNS server answers NS, MX and TXT. Lab scenarios accept NS, MX and TXT records. Simulation invents MX and TXT records.
    • On the open question: NS stays opt-in through -type. The default is still A,AAAA.
    • Limitation (documented in the README and ROADMAP): a recursive resolver usually answers SERVFAIL for a subzone whose every name server is gone. That case is reported as inconclusive, not flagged.

    Verified with TestResolveNSMXTXT (resolver plus dangling-ns hint), TestAnswerNSMXTXT and the new parse cases (lab zone), the SARIF writer test, and TestE2ELabDanglingNS (CLI against a lab zone with -sarif). Also ran the full go test ./..., -race on the touched packages, and golangci-lint run (0 issues).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: dnsenhancementhelp wantedseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions