Am getting this error on my server when trying to run docker-compose:
# docker-compose up -d
Pulling db (mysql:5.7)…
ERROR: Get “https://registry-1.docker.io/v2/”: dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: server misbehaving
That “server misbehaving” error when Docker tries to pull an image is a classic sign of a DNS resolution issue! It means your Docker daemon can’t properly translate the hostname registry-1.docker.io
into an IP address. Here are several things you can try to resolve this, moving from the simplest to slightly more involved:
1) Try Using Google’s Public DNS Servers:
If your current DNS server is unreliable, try switching to Google’s public DNS servers. You can do this temporarily or permanently.
-
Temporarily (for this session): You can try running Docker commands with specific DNS servers.
# docker run --dns 8.8.8.8 --dns 8.8.4.4 hello-world # docker-compose up -d
If this works, it indicates a problem with your default DNS.
2) Consider Restarting systemd-resolved
:
Sometimes, restarting the systemd-resolved
service itself can resolve issues it might be having.
# sudo systemctl restart systemd-resolved
After restarting, give Docker another try:
# docker-compose up -d