# Rancher-agent behind proxy

**URL:** https://forums.suse.com/t/rancher-agent-behind-proxy/14897
**Category:** General
**Created:** [July 25, 2019, 5:12pm UTC](https://forums.suse.com/t/rancher-agent-behind-proxy/14897 "2019-07-25T17:12:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![arjuin](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@arjuin](https://forums.suse.com/u/arjuin)
#### Post date: [July 25, 2019, 5:12pm UTC](https://forums.suse.com/t/rancher-agent-behind-proxy/14897/1 "2019-07-25T17:12:02Z")

</div>

I try to launch ranger-agent on machine behind a proxy with the following command:

> sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.1.7 --server [https://example.com](https://example.com) --token jrn9rpn9lcthxddwtmrhjsxk8hjs6mf55n4mflrxwmz6s685xzm76l --worker --etcd –controlplane

I get the following error :

> level=error msg=“Failed to connect to proxy” error=“dial tcp: lookup [example.com](http://example.com) on 10.220.220.200:53: no such host”

Docker is configured to point to my http and https proxy.  
When I launch a curl in a container, request thru the proxy is working.

I tried --add-host option to resolve this domain (even if it works on host and curl container) and I got:

> level=error msg=“Failed to connect to proxy” error=“dial tcp 34.X.X.X:443: connect: connection refused”

If I add env var http\_proxy an https\_proxy to container, it does not change. If I put incorrect proxy, it displays that the proxy cannot be reached. My question is: “failed to connect proxy” is relative to http/s proxy or something else in Rancher?  
Any idea why rancher-agent does not resolve domain and why connexion is refused whereas I can curl it?
