Hello everyone,
I am encountering a persistent networking issue with a Docker container running on an Arch Linux host by using docker run. The container appears unable to resolve DNS addresses, despite multiple troubleshooting attempts.
But at the same time other containers running with docker compose are working fine.
1. Environment Details:
-
Host OS: Arch Linux
-
Docker Version: 28.5.1
-
Container Image: ubuntu:latest (and all other images)
2. Run Command:
I run the container using the following command:
docker run -it -v ~/files/ubuntu.sources:/etc/apt/sources.list.d/ubuntu.sources --rm ubuntu:latest /bin/bash
(Note: The volume mount is for a custom sources.list, but the issue appears to be network/DNS related, not the file content itself.)
3. Actual Behavior (The Problem):
Once inside the container, it cannot resolve any domain names . For example, running apt update fails with errors similar to:
Temporary failure resolving...
4. Troubleshooting Steps Already Taken:
-
Tested with another image: The problem still exists.
-
Attempted DNS changes: I have repeatedly tried changing the DNS configuration inside the container (e.g., manually editing /etc/resolv.conf to use public DNS) or using “–dns”.
-
Tried Host Mode: I have tried running it in host mode, but it didn’t help.
5. Some clues
The nameserver in /etc/resolv.conf of the container running through docker compose is 127.0.0.11. However, containers running directly do not work properly regardless of the nameserver in /etc/resolv.conf.
The nameserver in /etc/resolv.conf on the host is 127.0.0.53.
6. Request for Help:
Has anyone experienced a similar comprehensive network failure with Docker on Arch Linux? What steps should I take next to diagnose whether this is a DNS issue, a firewall/iptables block on the host, or a Docker bridge network problem?
Any guidance would be greatly appreciated!
Thank you.
(I edited the topic because I found that the test results were wrong due to my mistake.)