CI "Could not resolve host" (DNS Failure)
A name lookup failed, so the client never reached the server. In CI this is usually a transient DNS hiccup on the runner network rather than a wrong hostname.
What this error means
A clone, install, or curl fails with Could not resolve host: <host>. Re-running the same job, unchanged, usually succeeds, the signature of a transient resolution blip.
shell
fatal: unable to access 'https://github.com/org/repo.git/': Could not resolve host: github.comCommon causes
Transient DNS resolution failure
A momentary DNS timeout or resolver hiccup on the runner network breaks the lookup; the host itself is fine.
A genuinely wrong or private hostname
A typo or an internal-only host that the runner cannot resolve fails every time, not just once.
How to fix it
Retry the network step
Wrap flaky network calls in a bounded retry so a single DNS blip does not fail the build.
shell
for i in 1 2 3; do
curl -fsSL https://example.com/install.sh && break
sleep $((i*5))
doneConfirm the host and resolver
- Verify the hostname is correct and publicly resolvable.
- Test resolution directly (
getent hosts <host>/nslookup <host>). - For private hosts, ensure the runner has the right DNS/VPC config.
How to prevent it
- Add retries around network-dependent steps.
- Pin dependencies/mirrors to reduce lookups.
- On managed runners, transient DNS blips are detected and the job is automatically retried, so a one-off failure does not break the build.
Related guides
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…
curl: (6) Could not resolve host in CIFix "curl: (6) Could not resolve host" in CI, a transient DNS failure during a download. How to retry and why…
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…