I realize this issue has already been talked about here: Docker build "Could not resolve 'archive.ubuntu.com'" apt-get fails to install anything
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
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.
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.
Are there any other solutions to this problem?