Skip to content
MtrXTools

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

  1. Check routes with `ip route` (Linux), `netstat -rn` (macOS) or `route print` (Windows) and confirm there is a default gateway.
  2. If only IPv6 fails, fix IPv6 routing or make the client prefer IPv4 (for example `node --dns-result-order=ipv4first`).
  3. Reconnect the VPN or add the route for the private network.
See which addresses the name returns

Got a different message? Paste it into the error explainer.

Related errors

All 19 Network errors