moby / moby/moby

rootless does not follow symlink to /run/netconfig/resolv.conf

Open
#52,035 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/rootless kind/bug status/0-triage
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
  1. sudo rm /etc/resolv.conf
  2. ln -s /var/run/netconfig/resolv.conf /etc/resolv.conf
  3. docker pull or docker login registry.example.com
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.