Skip to content
Latchkey

curl: (6) Could not resolve host in CI

curl exit code 6 means it could not resolve the hostname. In CI this is usually a transient DNS hiccup during an install script or asset download, not a wrong URL.

What this error means

A curl step fails with curl: (6) Could not resolve host: <host>. Re-running the unchanged job usually succeeds, the mark of a transient resolution blip.

shell
curl: (6) Could not resolve host: get.example.com

Common causes

Transient DNS resolution failure

A momentary resolver timeout breaks the lookup; the host is reachable a moment later.

A wrong or private hostname

A typo or internal-only host fails consistently, not intermittently.

How to fix it

Use curl built-in retries

curl can retry transient failures itself.

shell
curl --retry 5 --retry-all-errors --retry-delay 3 \
  -fsSL https://get.example.com/install.sh | bash

Verify the host

  1. Confirm the hostname is correct and public.
  2. Test resolution (getent hosts <host>).
  3. For internal hosts, check runner DNS/VPC settings.

How to prevent it

  • Use --retry / --retry-all-errors for curl in CI.
  • Prefer cached or pinned downloads.
  • On managed runners, transient DNS blips are detected and the job is automatically retried, so a one-off curl (6) does not fail the build.

Frequently asked questions

What causes "curl (6) resolve host"?
A momentary resolver timeout breaks the lookup; the host is reachable a moment later.
How do I fix curl (6) resolve host?
curl can retry transient failures itself.
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