CI "Temporary failure in name resolution" (EAI_AGAIN)
By Kaveh Alemi·Latchkey
EAI_AGAIN means the DNS resolver temporarily could not answer, a soft, retryable failure. In CI it usually reflects a momentary resolver or network hiccup, not a bad hostname.
What this error means
A step fails with Temporary failure in name resolution or getaddrinfo EAI_AGAIN <host>. Re-running the same job typically succeeds without any change.
shell
curl: (6) Could not resolve host: registry.example.com
Temporary failure in name resolution
Common causes
The DNS resolver was momentarily unavailable
A transient resolver timeout returns EAI_AGAIN; a retry a moment later resolves fine.
Network not fully up yet
Very early in a job or container start, networking/DNS may not be ready, causing a brief EAI_AGAIN window.
How to fix it
Retry the resolution-dependent step
A short backoff loop absorbs the transient resolver failure.
shell
for i in 1 2 3 4 5; do
getent hosts registry.example.com && break
sleep 3
done
Stabilize resolution
Ensure networking is up before the first lookup.
Verify resolver config (/etc/resolv.conf).
Use a reliable upstream resolver if you control the runner.
How to prevent it
Add retries around the first network calls in a job.
Avoid lookups before the network is ready.
On managed runners, EAI_AGAIN-class blips are detected and the job is automatically retried, so a one-off failure does not break the build.
Frequently asked questions
What causes "Temporary name resolution"?
A transient resolver timeout returns EAI_AGAIN; a retry a moment later resolves fine.
How do I fix Temporary name resolution?
A short backoff loop absorbs the transient resolver failure.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.