ENETUNREACH
Network is unreachable
Seen in Node.js (connect ENETUNREACH), Linux and macOS (Network is unreachable), ping, curl
Your own machine has no route to the network that address is on, so the connection fails before any packet leaves.
Common causes
- No default route: the interface is down, DHCP failed or the gateway is missing.
- An IPv6 address was tried on a machine or network without working IPv6 (very common with dual-stack hostnames).
- A VPN was disconnected or its routes for a private range were removed.
How to fix it
- Check routes with `ip route` (Linux), `netstat -rn` (macOS) or `route print` (Windows) and confirm there is a default gateway.
- If only IPv6 fails, fix IPv6 routing or make the client prefer IPv4 (for example `node --dns-result-order=ipv4first`).
- Reconnect the VPN or add the route for the private network.
Got a different message? Paste it into the error explainer.
Related errors
- getaddrinfo ENOTFOUND · The hostname doesn't exist in DNS
- getaddrinfo EAI_AGAIN · Temporary DNS failure
- ECONNREFUSED · Connection refused
- ETIMEDOUT · Connection timed out
- ECONNRESET · Connection reset by peer
- EHOSTUNREACH · No route to host
- Broken pipe · Wrote to a connection or pipe that was already closed
- Software caused connection abort · Your own system aborted the connection
- WSAETIMEDOUT (10060) · Windows connection attempt timed out
- WSAECONNREFUSED (10061) · Windows connection refused
- Request timed out. · Ping got no reply
- Destination host unreachable. · No path to the host could be found