zeroclaw-labs/zeroclaw · error
Failed to resolve host '{host}'
Error message
Failed to resolve host '{host}' What it means
Error "Failed to resolve host '{host}'" thrown in zeroclaw-labs/zeroclaw.
Source
Thrown at crates/zeroclaw-infra/src/net_guard.rs:842
/// # DNS pinning
///
/// This function validates only the supplied DNS answer. After it succeeds,
/// the caller must connect to one of these exact validated addresses and must
/// not resolve `host` again; otherwise DNS rebinding can replace the checked
/// destination.
///
/// # Errors
///
/// Returns an error when `ips` is empty, contains a known cloud metadata
/// address, or contains any non-globally-routable address — including one
/// reached through a configured NAT64 prefix.
pub fn validate_resolved_ips_are_public(
host: &str,
ips: &[std::net::IpAddr],
nat64_prefixes: &[Nat64Prefix],
) -> anyhow::Result<()> {
if ips.is_empty() {
anyhow::bail!("Failed to resolve host '{host}'");
}
for ip in ips {
if is_cloud_metadata_ip(*ip) {
return Err(metadata_block_error(host, *ip));
}
if let std::net::IpAddr::V6(v6) = ip {
// Overlapping prefixes translate one address to several different
// destinations. Every one of them is reachable, so the address is
// accepted only when all of them are acceptable.
for (prefix, embedded) in network_specific_embedded_ipv4s(*v6, nat64_prefixes) {
if is_cloud_metadata_ip(std::net::IpAddr::V4(embedded)) {
return Err(nat64_metadata_block_error(host, *v6, prefix, embedded));
}
if is_non_global_v4(embedded) {
anyhow::bail!(
"Blocked host '{host}' resolved to {v6}, which the configured NAT64 prefix \View on GitHub (pinned to 88bb9c8533)
Solutions
- Check DNS resolution and the hostname spelling; ensure the host is reachable from this machine.
When it happens
Trigger: Thrown at crates/zeroclaw-infra/src/net_guard.rs:842 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/7cfe7489ed6d83a6.
Report an issue: GitHub.