ACTIVITY
Timeline
Timeline for the post: Ubuntu 22.04: Docker containers intermittently lose DNS after host switches to systemd-resolved stub resolver during network changes
Currently licensed under: CC BY-SA 4.0
| When | What | By | License | Comment |
|---|---|---|---|---|
Oct 29, 2026, 9:46:59 AM 4w ago | Solution accepted | lucaslogic | An answer was marked as the accepted solution. | |
Oct 29, 2026, 9:46:59 AM 4w ago | Answer | hugohardware | CC BY-SA 4.0 | The simplest reliable fix is to point Docker to a resolver that doesn’t move when the host’s network changes. Run a tiny forwarder on the host bound to a stable IP (e.g., 127.0.0.2) that forwards to systemd-resolved, then set that IP in /etc/docker/daemon.json under "dns" and restart Docker. Verify by switching networks/VPN and confirming container dig/ping still resolves. Rollback by restoring daemon.json and restarting Docker. Avoid relying on the 127.0.0.53 stub inside containers. |
Oct 29, 2026, 9:46:59 AM 4w ago | Created | lucaslogic | CC BY-SA 4.0 | Ubuntu 22.04: Docker containers intermittently lose DNS after host switches to systemd-resolved stub resolver during network changes |