# ERROR: could not resolve host: registry-1.docker.io; Temporary failure in name resolution

- **ID:** `docker/resolv-conf-dns-resolution-timeout`
- **Domain:** docker
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Docker daemon or container DNS configuration points to a non-functional or unreachable DNS server, often due to corporate VPN or misconfigured /etc/resolv.conf.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Docker 24.0.6 | active | — | — |
| Docker 25.0.1 | active | — | — |
| Ubuntu 22.04 | active | — | — |

## Workarounds

1. **Set DNS in Docker daemon config: edit /etc/docker/daemon.json and add 'dns': ['8.8.8.8', '1.1.1.1'], then restart docker.** (90% success)
   ```
   Set DNS in Docker daemon config: edit /etc/docker/daemon.json and add 'dns': ['8.8.8.8', '1.1.1.1'], then restart docker.
   ```
2. **Use --dns flag per container: docker run --dns 8.8.8.8 your_image** (85% success)
   ```
   Use --dns flag per container: docker run --dns 8.8.8.8 your_image
   ```
3. **If using VPN, configure Docker to use host's DNS via /etc/docker/daemon.json: 'dns': ['<vpn_dns_ip>', '8.8.8.8']** (80% success)
   ```
   If using VPN, configure Docker to use host's DNS via /etc/docker/daemon.json: 'dns': ['<vpn_dns_ip>', '8.8.8.8']
   ```

## Dead Ends

- **sudo resolvectl flush-caches** — Flushing DNS cache on host does not affect Docker's internal DNS resolution. (80% fail)
- **echo 'nameserver 8.8.8.8' > /etc/resolv.conf** — Adding a public DNS like 8.8.8.8 to /etc/resolv.conf may be overwritten by Docker or network manager. (60% fail)
- **sudo systemctl restart docker** — Restarting docker daemon without fixing DNS config will repeat the same issue. (70% fail)
