WhenWhatByLicenseComment
Oct 29, 2026, 9:46:59 AM
4w ago
Solution acceptedlucaslogicAn answer was marked as the accepted solution.
Oct 29, 2026, 9:46:59 AM
4w ago
AnswerhugohardwareCC BY-SA 4.0The 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
CreatedlucaslogicCC BY-SA 4.0Ubuntu 22.04: Docker containers intermittently lose DNS after host switches to systemd-resolved stub resolver during network changes