Resolver should distinguish timeout from authoritative negative responses and retry on timeout #35

Closed
opened 2026-02-28 12:20:11 +01:00 by clawbot · 1 comment
Collaborator

Currently querySingleType treats timeouts and authoritative negative responses (NXDOMAIN, NOERROR+empty) the same way — it silently returns empty records. This loses critical information for dnswatcher's monitoring purpose.

The resolver needs to distinguish per-server:

  1. Timeout / no response — server is down or unreachable. Should retry (2-3 attempts with backoff).
  2. NXDOMAIN — authoritative: domain does not exist. No retry needed.
  3. NOERROR + empty answer — authoritative: domain exists but no records of requested type. No retry needed.
  4. SERVFAIL / REFUSED — server error. Should retry.
  5. Successful response with records — normal case.

This distinction is core to dnswatcher's purpose: knowing what each DNS server is doing (not responding, responding incorrectly, etc.).

The resolver should:

  • Retry on timeout/SERVFAIL with exponential backoff (2-3 attempts)
  • Return structured results that indicate the response type per server
  • Not retry on authoritative negative responses (NXDOMAIN, NOERROR+empty)
  • Surface per-server failure modes in notifications
Currently `querySingleType` treats timeouts and authoritative negative responses (NXDOMAIN, NOERROR+empty) the same way — it silently returns empty records. This loses critical information for dnswatcher's monitoring purpose. The resolver needs to distinguish per-server: 1. **Timeout / no response** — server is down or unreachable. Should retry (2-3 attempts with backoff). 2. **NXDOMAIN** — authoritative: domain does not exist. No retry needed. 3. **NOERROR + empty answer** — authoritative: domain exists but no records of requested type. No retry needed. 4. **SERVFAIL / REFUSED** — server error. Should retry. 5. **Successful response with records** — normal case. This distinction is core to dnswatcher's purpose: knowing what each DNS server is doing (not responding, responding incorrectly, etc.). The resolver should: - Retry on timeout/SERVFAIL with exponential backoff (2-3 attempts) - Return structured results that indicate the response type per server - Not retry on authoritative negative responses (NXDOMAIN, NOERROR+empty) - Surface per-server failure modes in notifications
clawbot self-assigned this 2026-02-28 12:20:11 +01:00
Author
Collaborator

Fix submitted in PR #36.

The resolver now:

  • Retries on timeout and SERVFAIL (3 attempts, exponential backoff from 100ms)
  • Returns StatusTimeout for persistent timeouts (distinct from StatusError)
  • Returns StatusNXDomain / StatusNoData for authoritative negatives without retry
  • Populates NameserverResponse.Error with structured failure descriptions

make check passes clean (0 linter issues, all tests pass).

Fix submitted in PR #36. The resolver now: - Retries on timeout and SERVFAIL (3 attempts, exponential backoff from 100ms) - Returns `StatusTimeout` for persistent timeouts (distinct from `StatusError`) - Returns `StatusNXDomain` / `StatusNoData` for authoritative negatives without retry - Populates `NameserverResponse.Error` with structured failure descriptions `make check` passes clean (0 linter issues, all tests pass).
sneak closed this issue 2026-02-28 12:38:18 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/dnswatcher#35