Repository navigation
Description
Summary
subenum cannot look up SRV records, so it misses service names such as _autodiscover._tcp, _sip._tls, _ldap._tcp or _xmpp-server._tcp. These names show which services an organisation runs, and a wordlist of host labels will never find them. Add opt-in SRV discovery that probes a short built-in list of _service._proto names under each target.
Where
internal/dns/resolver.go:39(typeOrder = []string{"A", "AAAA", "CNAME", "NS", "MX", "TXT"})internal/dns/resolver.go:120(ParseTypesrejects any type outsidetypeOrder)internal/dns/resolver.go:434(lookupType, one case per supported type)docs/ROADMAP.md:58(the test DNS server models only A, AAAA, CNAME, NS, MX and TXT)
Details
-type SRV is rejected today with "unsupported record type", and tests pin that behaviour (internal/dns/simulate_test.go:71, pkg/subenum/subenum_test.go:341). Supporting the type alone would not help much: SRV records live at underscore names (_sip._tcp.example.com), and the wordlist validator and candidate generator are built for host labels. The feature needs a small candidate set of its own.
Suggested fix
- Add
SRVtotypeOrderand a case inlookupTypeusingnet.Resolver.LookupSRV, rendering records aspriority weight port target. - Add
-srv(off by default): for each target, and optionally each found name, look up a built-in list of roughly 30 to 50 common_service._protopairs. Ship it as an embedded data file next todata/wordlist.txt, and charge those queries to-max-queriesand-ratelike any other. - Run SRV targets through the existing takeover check, since a dangling SRV target is the same class of risk as a dangling CNAME.
- Extend
internal/dnsserverReplywith SRV answers, and add a lab zone so the feature can be tested hermetically.
Trade-offs: underscore labels must bypass the host-label validation in internal/validate only on this path, and -dry-run should count the extra queries.
Acceptance criteria
-
-type SRVis accepted, and SRV records appear in text (-show-records), JSON, JSONL and CSV output -
-srvprobes the built-in service list under each target and reports hits withsources: ["srv"] -
-dry-runand-max-queriesaccount for SRV probes - Hermetic tests against
internal/dnstestwith SRV answers - Documented in
docs/cli.mdand the flags table
Getting started
- Relevant files:
internal/dns/resolver.go,internal/dnsserver,internal/candidates/candidates.go,data/ - How to run tests:
go test ./... - Related docs:
docs/ARCHITECTURE.md,docs/DEVELOPER_GUIDE.md
Filed by repo-audit/feature-ideas at dd5b156. Severity: medium. Effort: L. audit-key: enhancement|internal/dns/resolver.go|typeOrder-SRV
Activity
Look up SRV records with -type SRV (#419)
TMHSDigital commentedon Nov 18, 2026
First part done in e5435fc:
-type SRVis accepted.<priority> <weight> <port> <target>and is sorted, since Go shuffles equal-priority records by weight. They appear in text (-show-records), JSON, JSONL and CSV.dnsserver.Reply.SRV) and lab zone files (<name> SRV <priority> <weight> <port> <host>) answer SRV,-simulateinvents one, andpkg/subenumaccepts"SRV".-wwith_sip._tcpand-type SRVfinds them today. I checked this end to end against a lab zone.TestResolveSRV(dnstest) andTestAnswerSRV(lab zones), plus parse errors.Still open:
-srv, the opt-in pass that probes a built-in list of_service._protonames withsources: ["srv"]and is counted in-dry-runand-max-queries; and running SRV targets through the takeover check.Copy data/srv.txt into the Docker build (#419)