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

**Code:** `lookup registry-1.docker.io: no such host` · **Category:** Docker · **Seen on:** Docker

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

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/docker/build-dns-no-such-host)
