# Go "dial tcp: lookup proxy.golang.org: no such host" - Fix DNS in CI

> Fix Go "dial tcp: lookup proxy.golang.org: no such host" in CI - a DNS resolution failure reaching the module proxy from a sandboxed or air-gapped runner.

Source: https://latchkey.dev/learn/go/go-dial-tcp-lookup-proxy-no-such-host  
Updated: 2026-06-25

Go tried to reach the module proxy and DNS could not resolve its hostname. The name `proxy.golang.org` (or `sum.golang.org`) did not resolve - a transient DNS blip, a runner with no outbound DNS, or a network policy that blocks the lookup.

## Diagnose it: module path, proxy, or checksum?

Go module errors name the module but rarely the layer that failed. Separate the three: the module path does not resolve, the proxy cannot serve it, or the checksum database disagrees with what was downloaded.

```Terminal
# what Go resolves and from where
go env GOPROXY GOSUMDB GOPRIVATE GOFLAGS

# does the module resolve at all, bypassing the build?
go list -m -versions github.com/org/module

# verify the module cache against go.sum
go mod verify

# private modules must be excluded from proxy and sumdb
go env -w GOPRIVATE=github.com/yourorg/*
```

> A private module fetched through the public proxy fails with a confusing 410 or checksum mismatch rather than an auth error. Setting `GOPRIVATE` for your org prefix removes an entire class of CI-only module failures.

## FAQ

### What causes Go "dial tcp: lookup proxy.golang.org: no such host"?

There are 3 common causes: transient dns resolution failure, a runner with no outbound dns to the public proxy, and a network policy blocking the lookup. A brief DNS outage or an overloaded resolver makes the proxy hostname fail to resolve for a single attempt, then succeed on retry.

### How do I fix Go "dial tcp: lookup proxy.golang.org: no such host"?

There are 3 fixes depending on which cause you have: retry a transient dns failure, point goproxy at a reachable mirror, and serve modules from a warm cache. Work through them in order, since the first is the most common.

### What does Go "dial tcp: lookup proxy.golang.org: no such host" actually mean?

A go mod download or build fails with dial tcp: lookup proxy.golang.org: no such host.

### How do I stop Go "dial tcp: lookup proxy.golang.org: no such host" happening again?

Cache ~/go/pkg/mod so most builds skip the proxy entirely. The prevention section lists 3 changes that keep it from recurring.

### 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.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
