Skip to content

Timed-out and refused names are dropped; record them and offer a retry pass #217

Closed

Description

@TMHSDigital

Summary

Names whose lookup ends in a timeout, REFUSED or SERVFAIL are counted and then dropped. A run with a degraded verdict tells you how many names are unknown but not which, so the only way to close the gap is to re-run the whole wordlist. Recording the inconclusive names, and optionally re-testing them once at the end of the run, would make degraded runs recoverable.

Where

  • internal/scan/runner.go:734-738 (processJob): st.add(outcome) then if outcome != dns.OutcomeFound { return true }; the name is not kept anywhere
  • internal/scan/runner.go:173-188 (counters.add): timeout / refused / other only increment counters
  • internal/scan/verdict.go:38 (verdict): the run is marked degraded or unreliable from those counts

Details

The only trace of an inconclusive name is a -v log line. -stats reports the totals, and -diff already has to reason about "never verified" names (#151), but neither can list them. On a 5,000-name scan with a 3% timeout rate, about 150 names have an unknown answer and the user can't tell which ones.

Proposal

  1. Keep the inconclusive names per target (timeout, refused, other; never canceled, see Ctrl+C counts in-flight lookups as resolver failures and can raise a false "rate-limiting" abort with exit 1 #42).
  2. Add -retry-inconclusive (or reuse -attempts semantics): after the main pass, re-test those names once, at a lower rate if -rate is set. Names that resolve on the second pass are emitted as normal results; the verdict counts are updated.
  3. Add -inconclusive <file>: write the names that are still unknown, one per line, so they can be fed back with -w <file> or a later run.
  4. Report both counts in -stats (for example inconclusive_retried, inconclusive_remaining) as new fields, without renaming any existing field (ROADMAP: schemas only gain fields).

Who benefits

Anyone scanning through public resolvers or with -rate, where some timeouts are normal. Monitoring users get fewer false "removed" names in -diff.

Trade-offs / open questions

  • Memory: the list is bounded by the failure rate; the reliability guard already aborts above 20%.
  • Should the retry go to the trusted -dns-server rather than the -r pool?
  • Interaction with -resume and -max-duration (a budget stop should skip the retry pass).

Acceptance criteria

  • Inconclusive names are kept per target and never include canceled lookups
  • Optional end-of-run retry pass, covered by a test using internal/dnstest with injected timeouts
  • -inconclusive <file> writes the remaining names
  • -stats gains the new counts; existing fields unchanged
  • Flag documented via make docs-flags, README and CHANGELOG

Getting started

  • Relevant files: internal/scan/runner.go, internal/scan/verdict.go, internal/report/report.go, main.go (flags)
  • Tests: go test ./... (hermetic: use -simulate or internal/dnstest, never live DNS)
  • Docs: docs/ARCHITECTURE.md, docs/cli.md

Filed by repo-audit/feature-ideas at 3fd0128. Severity: high. Effort: M. audit-key: enhancement|internal/scan/runner.go|processJob-inconclusive

Activity

  1. added
    enhancement
    area: scan
    severity: high
    on Nov 11, 2026
  2. TMHSDigital commented on Nov 11, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in b9d5528.

    • Inconclusive names (timeout, refused, other) are now kept per scan. -retry-inconclusive / Config.RetryInconclusive looks each one up once more against the trusted resolver after the main pass. The pass is skipped after a reliability abort, an interrupt or once -max-duration runs out.
    • -inconclusive <file> writes the names still without an answer. -stats gains retried and recovered. pkg/subenum gains Stats.Retried, Stats.Recovered and Stats.Inconclusive.
    • Not done here: a slower rate for the retry pass. It uses the same -rate limiter as the main pass.

    Verified with new engine tests (TestRunRetryInconclusive, TestRunRetryInconclusiveSkippedAfterAbort) and a CLI test against the local test DNS server (TestE2EInconclusive), plus 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: scanenhancementseverity: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions