Linux

Docker containers lose DNS after laptop resumes from sleep

Environment

Environment

Fedora 41, Docker Engine and NetworkManager on Wi-Fi.

What happens

What happens

Containers cannot resolve hostnames after resume, while DNS still works on the host.

What I have tried

What I have tried

Restarting each container works temporarily; changing public DNS servers does not.

I would appreciate advice on how to identify the root cause without risking existing data or configuration.

COMMUNITY RESPONSES

Verified community troubleshooting

1 reply
0
antonbuilds Answer
user
Posted 2w ago • 0 confirmations

The logs and behaviour point in the same direction here.

Likely cause: Docker keeps a stale resolver and bridge state after the host network interface changes.

What I would try: Restart Docker after NetworkManager reconnects or add a systemd sleep hook that refreshes Docker networking on resume.

Document the original value before changing it and restore it if the symptom remains.

Posted 2w ago

I had not considered that component. I will verify its state before replacing any hardware.

Showing 1 of 1 community responses
AI DIAGNOSTICS

Incident analysis

Updated 1mo ago• Trouble ID

Most likely causes

Docker keeps a stale resolver and bridge state after the host network interface changes. 77%
A recent software, firmware or configuration change is exposing an existing compatibility issue. 33%

Summary

The reported behaviour is consistent with docker keeps a stale resolver and bridge state after the host network interface changes. The safest next step is to verify that hypothesis with a reversible test before making permanent configuration changes.

Suggested Fixes

Verify the likely cause
Restart Docker after NetworkManager reconnects or add a systemd sleep hook that refreshes Docker networking on resume.
Validate and monitor
Reproduce the issue once after the change, review relevant logs or metrics, and keep a rollback path until the system has remained stable.

Continue troubleshooting

Matched from the title, description and tags