What it means: The system resolver found no address for the host name your code tried to connect to.
Free online tool — DNS lookup tool: instant results, no signup.
Looks the name up in public DNS and shows every record it returns.
Node.js resolves host names for http, net, fetch and most libraries with dns.lookup(), which «uses the operating system facilities to perform name resolution» and is implemented as a call to getaddrinfo(3) on libuv's threadpool (Node.js dns docs). When that call finds nothing, you get:
Error: getaddrinfo ENOTFOUND api.example.com
{ errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'api.example.com' }The Node.js docs define ENOTFOUND as «DNS lookup failed», a failure «of either EAI_NODATA or EAI_NONAME», and note it is not a standard POSIX error. Per getaddrinfo(3), EAI_NONAME means «The node or service is not known» and EAI_NODATA means the host exists but has no network addresses defined. In DNS terms that is NXDOMAIN or a name with no A/AAAA record.
A different code, EAI_AGAIN (getaddrinfo EAI_AGAIN), is a temporary failure: the resolver could not be reached or returned a temporary error. ENOTFOUND is a definite «no such name»; EAI_AGAIN is «could not ask».
| Cause | What the error shows | Fix |
|---|---|---|
| Scheme or path in a host field | getaddrinfo ENOTFOUND https://api.example.com | Pass only the host, or pass a full URL to the URL parameter |
| Typo or wrong environment variable | An unexpected host, or undefined | Print the resolved config at startup |
| The DNS record does not exist | dig returns NXDOMAIN or no A/AAAA | Create the record |
| Internal name used outside the network | Works on VPN or in the office only | Connect the VPN or use the public name |
| Container DNS | Works on the host, fails in Docker or Kubernetes | Check the container's /etc/resolv.conf and network |
| npm registry or proxy host | npm ERR! getaddrinfo ENOTFOUND registry.npmjs.org | Check network, proxy and registry in .npmrc |
The first row accounts for a large share of reports. http.request({ host: 'https://api.example.com' }) looks up the literal string https://api.example.com as a host name, which cannot exist. Use host: 'api.example.com' or pass the URL string as the first argument.
Name resolution inside a container uses the container's own /etc/resolv.conf, not the host's. Containers on a user-defined Docker network resolve each other by name through Docker's embedded DNS; on the default bridge network they cannot (Docker bridge docs), so a compose-style service name used with plain docker run returns ENOTFOUND. In Kubernetes, a service name resolves only through the cluster DNS and only in the right namespace: db works from the same namespace, other namespaces need db.namespace.
Corporate VPNs often provide internal names through their own resolver. When the VPN is off, or a container does not inherit the VPN's DNS settings, internal names fail with ENOTFOUND while public names keep working.
docker run --rm --network mynet busybox nslookup db
kubectl run -it --rm dnscheck --image=busybox --restart=Never -- nslookup db.defaultundefined points straight at the bug./etc/hosts), then directly in DNS:getent hosts api.example.com # system resolver, like dns.lookup()
dig +short api.example.com A # public DNS only
dig +short api.example.com AAAAIf getent fails but dig works, the local resolver configuration is the problem; if both fail, the record is missing./etc/resolv.conf.npm config get registry and npm config get proxy; a mistyped registry or proxy host produces the same error.node -e "require('dns').lookup('api.example.com', (e, a) => console.log(e ? e.code : a))"
# 203.0.113.10Run it in the same environment as the failing app (host, container or CI job). The DNS lookup shows what public DNS returns for the name.
DNS (Domain Name System) translates domain names into IP addresses. DNS records are instructions that define where to route traffic, email, and how to verify domainownership.
Query all record types — A, AAAA, MX, NS, TXT, CNAME, SOA — in a single request.
Direct queries to authoritative servers. Results in milliseconds, no caching.
SPF, DKIM, and DMARC analysis to evaluate email protection against spoofing and phishing.
Save check results. Compare DNS records before and after registrar changes.
DNS check after deploy
SPF/DKIM/DMARC audit
DNS config audit
DNS zone control
v=spf1 TXT record.DNS check history, API keys and DNS change monitoring.
Sign up freeENOTFOUND means the name definitely has no address. EAI_AGAIN is a temporary failure: the resolver could not be reached or asked to try again later.
Check that both run in the same environment and that the host string in your code has no scheme or path. Inside Docker, the container's resolver may differ from the host's.
npm could not resolve the registry or proxy host. Check your connection, VPN, and the registry and proxy settings in .npmrc.
Yes. dns.lookup uses the operating system resolver through getaddrinfo, so /etc/hosts and the system DNS configuration apply. dns.resolve queries DNS servers directly.
Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.