Recently I faced problem while setup docker compose application
ERROR: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:57728->[::1]:53: read: connection refused
after short internet reading I discovered that it is connected with DNS query problems that are generated from my machine to ISP DNS server.
To avoid that kind of problems in future just redirected all my DNS traffic to the Google DNS instead of local ISP.
For doing it just need to edit resolv.conf file in Your Debian based machine:
Insert following lines if the file is empty or edit appropriate
nameserver 220.127.116.11 nameserver 18.104.22.168
After changing the DNS problem solves.