lookup registry-1.docker.io: no such host 🐳 Docker

dial tcp: lookup registry-1.docker.io: no such host / Temporary failure in name resolution during docker build

DNS isn’t working for the Docker daemon or inside build containers, so pulls and package downloads fail.

Seen on: Docker

Meaning

Containers copy DNS settings from the host, but systemd-resolved (127.0.0.53), VPN DNS and corporate DNS often don’t work from inside containers. apt-get update then shows “Temporary failure resolving 'deb.debian.org'”, and FROM fails with “no such host”.

Common causes

  • Host uses a local resolver (127.0.0.53) unreachable from containers
  • VPN/corporate DNS not forwarded to Docker
  • Network down or proxy required
  • Docker Desktop VM DNS glitch

⚡ Quick fix

  1. Set DNS servers in daemon.json and restart Docker
  2. Build with --network host as a test
  3. Restart Docker Desktop

Detailed fix by platform

Docker

  1. bash
    # /etc/docker/daemon.json
    { "dns": ["1.1.1.1", "8.8.8.8"] }
    sudo systemctl restart docker
    docker run --rm busybox nslookup deb.debian.org

How to diagnose

  1. Container DNS — docker run --rm busybox cat /etc/resolv.conf
  2. Lookup — docker run --rm busybox nslookup google.com
  3. Proxy — Is one required?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.