app: catch a search domain that swallows DNS queries
A tablet on a healthy network could not resolve anything. The DNS server answered the bare name correctly — NOERROR, two records, A and AAAA, with and without EDNS0 — so the earlier finding blamed the device's resolver. It was wrong. The network advertised hudelist.local as a search domain and the server silently dropped every query under it: not NXDOMAIN, nothing at all. Resolvers append search domains, so they waited for a reply that was never coming. Silence is the part that makes this vicious. A negative answer moves a resolver on; no answer looks like packet loss, so it retries, and some give up on the lookup entirely. It also explains how two devices on one network can disagree about whether DNS works — the phone tried the plain name first and never noticed. The probe now asks about a nonce name under each advertised search domain, where the wanted answer is NXDOMAIN and only silence is a fault. The finding is ordered ahead of dns.system_resolver_broken so the two cannot both fire: without that, this exact network gets told its device is broken. Severity follows the harm rather than the shape. HIGH when resolution is actually failing, MEDIUM when the domain is a black hole but this resolver happens to try the plain name first — calling that HIGH would be crying wolf on a network that works. The message names the fix and notes that .local is reserved for mDNS by RFC 6762 and widely dropped by design, while home.arpa (RFC 8375) is the name reserved for this. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
cfa58e8d60
commit
a17c3fd9e6
@@ -668,7 +668,48 @@ class RunViewModel(app: Application) : AndroidViewModel(app) {
|
||||
val o = v as? kotlinx.serialization.json.JsonObject ?: continue
|
||||
fun str(k: String) =
|
||||
(o[k] as? kotlinx.serialization.json.JsonPrimitive)?.content
|
||||
if (str("verdict") != "server answers, device resolver does not") continue
|
||||
val verdict = str("verdict")
|
||||
val ref0 = str("network_ref")
|
||||
val iface0 = networks.firstOrNull { it.id == ref0 }?.iface
|
||||
?.takeIf { it.isNotBlank() } ?: "this network"
|
||||
if (verdict == "search domain swallows queries") {
|
||||
// Severity follows the harm, not the shape: the same misconfiguration
|
||||
// is fatal on a resolver that tries the search form and invisible on
|
||||
// one that does not, and saying "high" for a network that currently
|
||||
// resolves fine would be crying wolf.
|
||||
val breaking = str("system_resolves") != "true"
|
||||
out.add(
|
||||
Finding(
|
||||
id = ids.uuid(),
|
||||
code = FindingRegistry.DNS_SEARCH_DOMAIN_UNANSWERED.code,
|
||||
category = FindingRegistry.DNS_SEARCH_DOMAIN_UNANSWERED.category,
|
||||
severity = if (breaking) Severity.HIGH else Severity.MEDIUM,
|
||||
confidence = Confidence.HIGH,
|
||||
title = "The network's search domain swallows DNS queries ($iface0)",
|
||||
description = "This network hands out " +
|
||||
"${str("search_domains") ?: "a search domain"} as a DNS " +
|
||||
"search domain, but its server never answers queries under " +
|
||||
"it — not even to say the name does not exist. Resolvers " +
|
||||
"append that domain to lookups, so they wait for a reply " +
|
||||
"that never comes. " +
|
||||
(if (breaking) {
|
||||
"That is why names are not resolving on this device."
|
||||
} else {
|
||||
"Name resolution still works here, because this " +
|
||||
"resolver tries the plain name first — another " +
|
||||
"device on the same network may fail outright."
|
||||
}) +
|
||||
" Fix it on the router: either stop advertising the search " +
|
||||
"domain, or make the server answer for it, including " +
|
||||
"NXDOMAIN for names it does not have. Note that .local is " +
|
||||
"reserved for mDNS (RFC 6762) and is widely dropped by " +
|
||||
"design; home.arpa (RFC 8375) is the name reserved for this.",
|
||||
evidenceRefs = listOf(EvidenceRef(t.id)),
|
||||
)
|
||||
)
|
||||
continue
|
||||
}
|
||||
if (verdict != "server answers, device resolver does not") continue
|
||||
val ref = str("network_ref")
|
||||
val where = networks.firstOrNull { it.id == ref }?.iface
|
||||
?.takeIf { it.isNotBlank() } ?: "this network"
|
||||
|
||||
Reference in New Issue
Block a user