Docker Community Forums

Share and learn in the Docker community.

Docker login fails with DNS error

Expected behavior

I am able to login to docker hub!

Actual behavior

Login fails (password is definitely correct!):

Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username:
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: Get https://auth.docker.io/token?account=mtbdeano&client_id=docker&offline_token=true&service=registry.docker.io: dial tcp: lookup auth.docker.io on 192.168.65.1:53: dial tcp 192.168.65.1:53: getsockopt: connection refused

Information

Since today i have been unable to login to docker hub to pull images here’s the diagnostic (876BEF43-9ED2-4A69-8188-553418AE6AA5):

Docker for Mac: version: mac-v1.12.0-beta16.2
OS X: version 10.11.5 (build: 15F34)
logs: /tmp/20160628-164004.tar.gz
failure: No error was detected
[OK]     docker-cli
[OK]     app
[OK]     menubar
[OK]     virtualization
[OK]     system
[OK]     osxfs
[OK]     db
[OK]     slirp
[OK]     moby-console
[OK]     logs
[OK]     vmnetd
[OK]     env
[OK]     moby
[OK]     driver.amd64-linux

the docker info is below.

docker info
Containers: 13
 Running: 0
 Paused: 0
 Stopped: 13
Images: 115
Server Version: 1.12.0-rc2
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 128
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge null host overlay
Swarm: inactive
Runtimes: default
Default Runtime: default
Security Options: seccomp
Kernel Version: 4.4.13-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.954 GiB
Name: moby
ID: 6V2D:44KF:4EKJ:PGBJ:WRDB:KCY6:OHHS:TDSF:TXWP:2LQS:32R5:XIPG
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 22
 Goroutines: 30
 System Time: 2016-06-28T20:38:12.684481639Z
 EventsListeners: 1
No Proxy: *.local, 169.254/16
Username: <redacted>
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8

Steps to reproduce the behavior

  1. just type docker login
  2. it fails

For some strange reason, same is happening here.
However, if we remove our internal DNS server from resolv.conf, it is working properly again.

walter@Super-Grover-53:~/docker$ docker login Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one. Username (XXX): Password: Error response from daemon: Get https://registry-1.docker.io/v2/: Get https://auth.docker.io/token?account=XXX&client_id=docker&offline_token=true&service=registry.docker.io: dial tcp: lookup auth.docker.io on 192.168.65.1:53: dial tcp 192.168.65.1:53: getsockopt: connection refused walter@Super-Grover-53:~/docker$

Our internal DNS server has no relation whatsoever with 192.168.65.0/24 so unclear where this range originates from.
Docker info shows same version as the above version: Server Version: 1.12.0-rc2

For now, the issue has been fixed on our location.
After restarting our bind service, issue is gone.

Hope it will stay that way, will update when the issue returns.

I’m getting the same kind of error but it’s very sporadic.

Example:

Building nginx
Step 1/6 : FROM tutum/nginx
ERROR: Service ‘nginx’ failed to build: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.65.1:53: server misbehaving

I open a new tab, run the same command and it works fine. It almost feels like the docker ‘state’ gets out of whack in the current shell and needs a new one to fix itself.