CI "curl: (6) Could not resolve host" - DNS Failure on Runner
By Kaveh Alemi·Latchkey
curl exit code 6 is CURLE_COULDNT_RESOLVE_HOST - the name never resolved, so no connection was even attempted. On a runner this is usually a transient resolver blip that clears on retry.
What this error means
A curl download or API call fails immediately with curl: (6) Could not resolve host: <name>. Nothing connected because DNS returned nothing. The same step typically passes on a re-run with no change.
CI log
curl: (6) Could not resolve host: api.github.com
Common causes
Transient DNS resolver blip
The upstream resolver briefly failed or timed out. DNS is best-effort UDP, so a momentary blip yields a hard "could not resolve" that clears on retry.
Missing or broken resolver configuration
A container with an empty or wrong /etc/resolv.conf, or a runner whose DNS was not yet configured, cannot resolve any name until it is fixed.
Re-run the step or wrap curl in a bounded retry - a one-off blip clears.
If it persists, set a working nameserver in /etc/resolv.conf.
For containers, pass --dns or fix the daemon DNS settings.
How to prevent it
Wrap network steps in bounded retry-with-backoff (curl --retry).
Ensure runners and containers ship a valid resolver config.
Cache or mirror dependencies to cut external DNS lookups.
Frequently asked questions
What causes ""curl: (6) Could not resolve host""?
The upstream resolver briefly failed or timed out. DNS is best-effort UDP, so a momentary blip yields a hard "could not resolve" that clears on retry.
How do I fix "curl: (6) Could not resolve host"?
Confirm resolution and config
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.