ENOTFOUND API Origin: Application & API OSI layer 7 · Application Last updated 13 Oct 2026

Error: getaddrinfo ENOTFOUND host / Name or service not known

DNS lookup for the hostname failed — the name is wrong, doesn’t exist, or this machine can’t resolve it.

Exact message you may see getaddrinfo ENOTFOUNDName or service not knownCould not resolve hostnodename nor servname providedTemporary failure in name resolution
Seen on: Linux Node.js Python Docker

Meaning

Before connecting, the client resolves the hostname to an IP. ENOTFOUND (Node), socket.gaierror / “Name or service not known” (Python, Linux) and “Could not resolve host” (curl) all mean that step failed.

Common causes

  • Typo in hostname, or protocol included in a host field (https://api.x.com where only api.x.com is expected)
  • Internal hostname not resolvable from this network/container
  • Docker service name used outside the compose network
  • DNS server down / no internet / VPN required
  • Domain expired or DNS record removed

⚡ Quick fix

  1. Resolve it yourself: nslookup host or dig host
  2. Pass only the hostname where a host is expected (no scheme, no path)
  3. Check VPN / corporate DNS, and /etc/resolv.conf inside containers
  4. In Docker Compose, call services by their service name from inside the network

Detailed fix by platform

Linux

  1. Check DNS from the same machine/container:
    bash
    nslookup api.example.com
    dig +short api.example.com
    cat /etc/resolv.conf
    docker compose exec app getent hosts db

How to diagnose

  1. Hostname — Exactly what string is resolved?
  2. DNS — Does nslookup work here?
  3. Network — VPN, container network or offline?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

0x80070035 — 0x80070035: The network path was not found (System error 53) (Windows)0x800700350x80072EE7 — Error 0x80072EE7 (Windows Update / Microsoft Store: server name could not be resolved) (Windows)0x80072EE71000 — Cloudflare Error 1000: DNS points to prohibited IP (Cloudflare)10001001 — Cloudflare Error 1001: DNS resolution error (Cloudflare)100114 UNAVAILABLE — gRPC Error: 14 UNAVAILABLE: No connection established / failed to connect to all addresses (API)14 UNAVAILABLE511 — HTTP 511 Network Authentication Required (HTTP)511auth/network-request-failed — Firebase Auth: auth/network-request-failed — A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred (Authentication)auth/network-request-…captive portal — Browser: This network requires you to sign in — captive portal (hotel, airport, café Wi-Fi) blocking HTTPS sites (Browser)captive portalENOTFOUND

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.