Skip to content
Latchkey

CI "curl: (6) Could not resolve host" - DNS Failure on Runner

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.

How to fix it

Confirm resolution and config

Terminal
getent hosts api.github.com || nslookup api.github.com
cat /etc/resolv.conf

Retry, then fix config if it persists

  1. Re-run the step or wrap curl in a bounded retry - a one-off blip clears.
  2. If it persists, set a working nameserver in /etc/resolv.conf.
  3. 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.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card