rootless does not follow symlink to /run/netconfig/resolv.conf
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 72.1k
- Forks
- 19.2k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 164
Description
Description
In the rootless context docker does not follow symlinks from /var/run to /run.
When /etc/resolv.conf is linked to /var/run/netconfig/resolv.conf, and a link exists from /var/run to /run, DNS resolution fails in the rootless context. It uses the slirip4netns fallback nameserver running on 10.0.2.3.
It works fully well with the default context (daemon running as root), and with /etc/resolv.conf linked to /run/netconfig/resolv.conf in rootless.
The most likely source of the /var/run/netconfig/resolv.conf symlink is that my server was upgraded from SLES 12 to SLES 15 some years go.
If anyone stumbles upon this: try linking your /etc/resolv.conf to /run/netconfig/resolv.conf:
ln -s /run/netconfig/resolv.conf /etc/resolv.conf
Reproduce
- sudo rm /etc/resolv.conf
- ln -s /var/run/netconfig/resolv.conf /etc/resolv.conf
- docker pull or docker login registry.example.com
- you will get a timeout since registry.example.com cannot be resolved by slirp4netns local dns
Expected behavior
dns resolution should work fine when /var is linked to /run
docker version
client 28.5.1-ce
api 1.51
go 1.24.10
containerd 1.7.29
runc 1.3.4
slirp4netns 1.2.2
docker info
Unfortunately I cannot post this, since the bug happened on my company machine
Additional Info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Docker's rootless DNS and resolv.conf handling, especially where the slirp4netns fallback nameserver is selected. Reproduce the setup with /etc/resolv.conf pointing through /var/run to /run, then verify that registry.example.com resolves without falling back to 10.0.2.3.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go, linux
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100