toolbox: /etc/resolv.conf is broken when it's an absolute symbolic link on the host

systemd-resolved has you symlink /etc/resolv.conf to some other location (under /run/systemd/resolve). When the host volume /etc is mounted, this location of course does not exist, so all hostname access within the container fails.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 19 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I sent a fix for that in PR #380 a while ago.

Just making sure we stay on top of it 😃 Fedora is aiming to enable systemd-resolved by default in Fedora 33 (link).

An update about the impending systemd-resolved change in Fedora 33.

By default, Fedora will ship /etc/resolv.conf as a relative symbolic link to ../run/systemd/resolve/stub-resolv.conf, and so does Ubuntu. This already works since Toolbox 0.0.14 because of commit d63b0a9c0f1cd8a137ebc818b297f3b9303b5c32

This situation is an illustration of the benefits of a relative symbolic link. It ensures that the link continues to resolve properly even when the prefix or the root is changed.

So, if you need a quick solution that works with Toolbox as it’s shipping today, I’d suggest switching to a relative symbolic link on your systems.

What doesn’t work, and we need to fix, are absolute symbolic links. ie., a /etc/resolv.conf that links to /run/systemd/resolve/stub-resolv.conf.