TL;DR: Try restarting your docker virtual machine.
I recently encountered this issue when doing a docker push :
2015/08/23 14:39:30 Put https://index.docker.io/v1/repositories/foo/bar/: dial tcp: lookup index.docker.io on 10.0.1.254:53: no answer from server
I had just switched from my home to my work networks, and noticed that the IP address that it mentioned was that of my home router, so for some reason, docker had cached that DNS server address.
Restarting the docker virtual machine fixed the issue. If you’re on a Mac, you can just stop the virtual machine and run boot2docker up.