I was having the same issue connecting to a private repository (in Azure). I’ve seen other forums suggesting the change of DNS. I query using my DNS and 8.8.8.8 and both returned exactly the same.
Doing docker login
didn’t work(Client.Timeout). But after I changed /etc/resolve.conf and put 8.8.8.8 there, it worked (even tho it returned exactly the same info as my default DNS).
It also works if you use 1.1.1.1 (DNS from CloudFlare).
So my suspicion is that the docker client has some issue resolving names when going thru the OS provided mechanism. But specifying a direct DNS server, it seems to work.