title: "Temporary failure resolving 'archive.ubuntu.com'" error when doing apt-get update in docker
body: <p>I realize this issue has already been talked about here: <a href="https://stackoverflow.com/questions/24991136/docker-build-could-not-resolve-archive-ubuntu-com-apt-get-fails-to-install-a">Docker build &quot;Could not resolve &#39;archive.ubuntu.com&#39;&quot; apt-get fails to install anything</a> </p>
  
  <p>I tried to build a docker image that uses ubuntu:16.04 and tried to run apt-get update but it would throw this error</p>
  
  <pre><code>    Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
    Temporary failure resolving 'archive.ubuntu.com'
  Err:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
    Temporary failure resolving 'security.ubuntu.com'
  Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
    Temporary failure resolving 'archive.ubuntu.com'
  Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
    Temporary failure resolving 'archive.ubuntu.com'
  Reading package lists...
  W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'archive.ubuntu.com'
  W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
  W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
  W: Some index files failed to download. They have been ignored, or old ones used instead.
  </code></pre>
  
  <p>I tried the solution in the above link but that still did not seem to solve my issue. I created the daemon.json which contains the appropriate DNS address and placed it in /etc/docker/ as mentioned and restarted docker but that still did not solve my issue. I tried the other accepted answer where we add the DNS address to /etc/default/docker but that didn't work either. If it helps, I'm using internet through a university network. </p>
  
  <p>Are there any other solutions to this problem?</p>