{"record":{"id":"a0c3299107ab8cfe","repo":"quickwit-oss/quickwit","slug":"dns-resolution-did-not-yield-any-record-for-hostna","errorCode":null,"errorMessage":"DNS resolution did not yield any record for hostname {addr:?}","messagePattern":"DNS resolution did not yield any record for hostname (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-common/src/net.rs","lineNumber":273,"sourceCode":"fn is_dormant(interface: &NetworkInterface) -> bool {\n    interface.is_dormant()\n}\n\n#[cfg(not(any(target_os = \"linux\", target_os = \"android\")))]\nfn is_dormant(_interface: &NetworkInterface) -> bool {\n    false\n}\n\n/// Converts an object into a resolved `SocketAddr`.\npub async fn get_socket_addr<T: ToSocketAddrs + std::fmt::Debug>(\n    addr: &T,\n) -> anyhow::Result<SocketAddr> {\n    lookup_host(addr)\n        .await\n        .with_context(|| format!(\"failed to parse address or resolve hostname {addr:?}\"))?\n        .next()\n        .ok_or_else(|| {\n            anyhow::anyhow!(\"DNS resolution did not yield any record for hostname {addr:?}\")\n        })\n}\n\nfn is_forwardable_ip(ip_addr: &IpAddr) -> bool {\n    static NON_FORWARDABLE_NETWORKS: LazyLock<Vec<IpNetwork>> = LazyLock::new(|| {\n        // Blacklist of non-forwardable IP blocks taken from RFC6890\n        [\n            \"0.0.0.0/8\",\n            \"127.0.0.0/8\",\n            \"169.254.0.0/16\",\n            \"192.0.0.0/24\",\n            \"192.0.2.0/24\",\n            \"198.51.100.0/24\",\n            \"2001:10::/28\",\n            \"2001:db8::/32\",\n            \"203.0.113.0/24\",\n            \"240.0.0.0/4\",\n            \"255.255.255.255/32\",","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-common/src/net.rs#L255-L291","documentation":"`get_socket_addr` resolves a host:port to a SocketAddr using Tokio's `lookup_host`. If the address parses but DNS lookup returns an empty iterator — the hostname resolved with no records — it bails with this message. Preceded by a context error for unparseable/failed lookups, this one specifically means resolution succeeded but produced nothing.","triggerScenarios":"Calling resolve/get_socket_addr with a hostname whose DNS lookup returns zero records: newly created DNS entry not propagated yet, hostname removed, or /etc/hosts entry deleted.","commonSituations":"Configuring peer addresses in a cluster with a hostname that doesn't exist in DNS; Kubernetes service name typo; DNS zone issues yielding NXDOMAIN-style empty answers; startup racing DNS propagation after container creation.","solutions":["Verify the hostname exists: `dig <hostname>` / `nslookup <hostname>` from the quickwit node.","Fix the hostname in the config (peer seeds, advertised address, gRPC endpoints).","Add retry/backoff around startup resolution to tolerate DNS propagation delays.","Use IPs directly for static clusters if DNS is unreliable."],"exampleFix":"// before\npeer_seeds = [\"quickwit-0.internal\"]\n// after (verify hostname or use address that resolves)\npeer_seeds = [\"quickwit-0.quickwit-headless.default.svc.cluster.local:7280\"]","handlingStrategy":"retry","validationCode":"let resolved = tokio::net::lookup_host((host.clone(), port)).await;\nif matches!(&resolved, Ok(addrs) if addrs.count() == 0) {\n    eprintln!(\"host {host} resolves to no records; fix DNS before starting\");\n}","typeGuard":null,"tryCatchPattern":"let addr = loop {\n    match get_socket_addr(&addr_str).await {\n        Ok(a) => break a,\n        Err(e) if e.to_string().contains(\"did not yield any record\") => {\n            tokio::time::sleep(Duration::from_secs(2)).await; // DNS propagation\n        }\n        Err(e) => return Err(e),\n    }\n};","preventionTips":["Resolve hostnames once at startup and cache, with retries for propagation.","Verify DNS entries (dig/nslookup) on the node itself, not just the operator machine.","Prefer stable fully-qualified service names in clustered deployments."],"tags":["dns","network","resolution"],"backgroundTag":"connection-refused","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}