Error AtlasError Documentation and Resolution

Node.js hostname lookup failed with ENOTFOUND

Error: getaddrinfo ENOTFOUND

Node could not resolve the requested host before opening the connection. Diagnose the hostname and the resolver available to the running process instead of treating this as a refused port or an HTTP response.

ENOTFOUNDnetworking
Error: getaddrinfo ENOTFOUND
  • A host configuration contains a typo, unresolved variable, or an entire URL where a hostname is expected.
  • A private service name is unavailable outside its container network or private DNS environment.
  • The runtime environment has a resolver or network configuration problem.
  1. Inspect the error's hostname without exposing credentials. In APIs with a hostname option, pass only the hostname; keep scheme, port, and path in their appropriate fields or use a parsed URL.
  2. Test name resolution from the same machine or container as the application. A successful lookup on your laptop does not establish that a CI runner can resolve the name.
  3. For private services, verify the service name, network membership, and required private resolver. Do not replace private DNS with a public resolver or hard-code a transient IP as a general fix.
  4. If a known-good hostname still fails, inspect environment resolver configuration and resource limits. Node's lookup errors do not always prove that the domain itself is nonexistent.
Node.js Docs: Common system errors