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).
curl: (5) Could not resolve proxy: proxy.corp.exmapleCommon 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
- Print the proxy env vars and check the hostname is spelled correctly.
- Confirm the name resolves from the runner.
- Fix the value (or use the proxy IP if DNS is the issue) and re-run.
echo "$HTTP_PROXY $HTTPS_PROXY"
getent hosts proxy.corp.exampleSet proxy env vars consistently
Define the proxy once with a resolvable host so every client uses the same correct value.
env:
HTTP_PROXY: http://proxy.corp.example:8080
HTTPS_PROXY: http://proxy.corp.example:8080How 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.