Skip to content
Latchkey

curl "Could not resolve proxy" in CI

curl tried to resolve the proxy host named in the proxy environment variable and DNS returned nothing. The failure is the proxy name itself, not the destination: the proxy value is wrong, or DNS for that name does not work in this environment.

What this error means

curl fails immediately with "Could not resolve proxy: <name>" (exit 5), and unsetting the proxy env vars lets direct requests through (if egress allows).

Terminal
curl: (5) Could not resolve proxy: proxy.corp.exmaple

Common causes

The proxy hostname is wrong or misspelled

A typo or an internal proxy name that does not resolve in this network makes HTTP_PROXY/HTTPS_PROXY point at a non-existent host.

DNS for the proxy name is unavailable here

The proxy name only resolves on a network the runner cannot reach, so lookup fails inside CI.

How to fix it

Correct and verify the proxy value

  1. Print the proxy env vars and check the hostname is spelled correctly.
  2. Confirm the name resolves from the runner.
  3. Fix the value (or use the proxy IP if DNS is the issue) and re-run.
Terminal
echo "$HTTP_PROXY $HTTPS_PROXY"
getent hosts proxy.corp.example

Set proxy env vars consistently

Define the proxy once with a resolvable host so every client uses the same correct value.

.github/workflows/ci.yml
env:
  HTTP_PROXY: http://proxy.corp.example:8080
  HTTPS_PROXY: http://proxy.corp.example:8080

How to prevent it

  • Set proxy env vars from a single validated source, not per-step copies.
  • Verify the proxy hostname resolves from the runner network.
  • Use the proxy IP when the proxy name is not resolvable in CI.

Frequently asked questions

What causes ""Could not resolve proxy""?
A typo or an internal proxy name that does not resolve in this network makes HTTP_PROXY/HTTPS_PROXY point at a non-existent host.
How do I fix "Could not resolve proxy"?
Correct and verify the proxy value

Related guides

References

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