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.comCommon 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 | bashVerify the host
- Confirm the hostname is correct and public.
- Test resolution (
getent hosts <host>). - For internal hosts, check runner DNS/VPC settings.
How to prevent it
- Use
--retry/--retry-all-errorsfor 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.
Related guides
CI "Could not resolve host" (DNS Failure)Fix "Could not resolve host" in CI, a transient DNS failure reaching a registry. How to retry it and why a DN…
CI "Temporary failure in name resolution" (EAI_AGAIN)Fix "Temporary failure in name resolution" (EAI_AGAIN) in CI, a transient DNS resolver failure. How to retry…
CI "Connection timed out" (ETIMEDOUT) DownloadingFix "Connection timed out" / ETIMEDOUT in CI while downloading deps, a transient network stall. How to retry…
Proxy/Firewall Blocking Outbound Traffic in CIFix outbound requests blocked by a proxy or firewall in CI (connection refused, proxy 403). How to configure…