Docker error response from daemon client.Timeout exceeded

I was trying to set up Docker in my machine running ubuntu 18.0.4. I got this error “Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)”, while issuing ‘Docker login’ command from the terminal.

Screenshot from 2018-12-25 13-05-10.png

I have learnt that the fix for this issue is to add couple of more entires in the resolve.conf file.

Navigate to /etc/resolv.conf

Add the following nameserver entries

nameserver 8.8.8.8

nameserver 8.8.4.4

docker dns change.png

After making this change, i was able to successfuly login to docker hub from the terminal.