title: Can't docker pull - connection refused
body: <p>I am running the following command from docker within an ubuntu virtualbox and getting a connection refused error.</p>
  
  <p>I am behind a corporate proxy and have configured my environmental vairables to use the proxy and username and password. I also tried using a proxychain.</p>
  
  <pre><code>root@mbak1-VirtualBox:~# sudo proxychains docker pull busybox
  ProxyChains-3.1 (http://proxychains.sf.net)
  Using default tag: latest
  Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp 54.152.209.167:443: getsockopt: connection refused
  
  root@mbak1-VirtualBox:~# docker pull hello-world
  Using default tag: latest
  Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp 35.169.231.249:443: getsockopt: connection refused
  </code></pre>
  
  <p>My situation seems to be the exact same as the following:</p>
  
  <p><a href="https://github.com/moby/moby/issues/31510" rel="nofollow noreferrer">https://github.com/moby/moby/issues/31510</a></p>
  
  <h2>Update</h2>
  
  <p>I tried adding my proxy config to the following file but it didn't work. Additionally the file did not exist: /etc/sysconfig/docker .</p>
  
  <p>I also tried to access the actual URL but I am getting a JSON response saying unauthorized.</p>
  
  <p><a href="https://i.stack.imgur.com/lgBld.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lgBld.png" alt="enter image description here"></a></p>
  
  <h2>update2</h2>
  
  <p>I think the problem is my DNS config.
  In the virtual machine I am getting the following for the lookup:</p>
  
  <pre><code>mbak1@mbak1-VirtualBox:~$ nslookup registry-1.docker.io
  Server:     127.0.0.1
  Address:    127.0.0.1#53
  
  Non-authoritative answer:
  Name:   registry-1.docker.io
  Address: 34.200.28.105
  Name:   registry-1.docker.io
  Address: 52.54.216.153
  Name:   registry-1.docker.io
  Address: 34.200.90.16
  Name:   registry-1.docker.io
  Address: 52.204.202.231
  Name:   registry-1.docker.io
  Address: 52.22.181.254
  Name:   registry-1.docker.io
  Address: 54.152.209.167
  Name:   registry-1.docker.io
  Address: 34.205.207.96
  Name:   registry-1.docker.io
  Address: 35.169.231.249
  </code></pre>