Name resolution failure — resolver versus record failure
An application name-resolution failure can originate in malformed input, NSS source selection, local hosts mappings, DNS transport, temporary resolver errors or absent records. getent follows system name-service configuration; dig queries DNS and may not match application resolution. Compare the exact name, search domain, address family and resolver used by the affected application. Check the active resolver owner and distinguish NXDOMAIN, SERVFAIL and transport timeout; EAI_NONAME is an API result, not proof of NXDOMAIN. Fix incorrect names/records with the responsible owner, or restore the intended resolver configuration after checking its management layer; avoid overwriting managed resolv.conf or leaking internal names to public resolvers. Verify application resolution and connectivity for the same name. Roll back the resolver or DNS record using the approved change history; account for caching and TTL. Prevent with monitoring and documented DNS ownership. The fixture rejects a nonnumeric address under AI_NUMERICHOST, then resolves a numeric loopback address with the same flag; it sends no DNS queries and is not an NXDOMAIN reproduction. Example prerequisites: Linux, Bash, Python 3. Run as a non-root user in a private temporary working directory. Example scope: native API error (not DNS). Expected output: EAI_NONAME for nonnumeric input; numeric lookup succeeds. No system configuration changes.
Formal Syntax & Structure
getent ahosts NAME; dig NAME; resolvectl status (if managed by systemd-resolved)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| getent | diagnostic evidence | System name-service resolution. |
| dig | diagnostic evidence | DNS response and status. |
| EAI_NONAME | diagnostic evidence | Name/service lookup error; context determines cause. |
Return Value
Expected normalized laboratory result: EAI_NONAME for nonnumeric input; numeric lookup succeeds. A passing fixture does not prove that a live incident has the same cause.
Working Example
python3 - <<'PY'import sockettry: socket.getaddrinfo('demo.invalid',80,socket.AF_INET,socket.SOCK_STREAM,0,socket.AI_NUMERICHOST)except socket.gaierror as e: assert e.errno==socket.EAI_NONAMEelse: raise AssertionError('numeric host rejection expected')rows=socket.getaddrinfo('127.0.0.1',80,socket.AF_INET,socket.SOCK_STREAM,0,socket.AI_NUMERICHOST)assert rows and rows[0][4]==('127.0.0.1',80)print('EAI_NONAME for nonnumeric input; numeric lookup succeeds')PY