Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS resolver broken inside systemd-container #116

Open
ant9000 opened this issue Oct 3, 2018 · 3 comments
Open

DNS resolver broken inside systemd-container #116

ant9000 opened this issue Oct 3, 2018 · 3 comments

Comments

@ant9000
Copy link

ant9000 commented Oct 3, 2018

I've successfully used a debos recipe on my laptop, but the same recipe fails on my home workstation - debootstrap cannot proceed because the container does not resolve DNS names. My problem is maybe related to #101 and #48.

Both machines are Debian Stretch, and I can't find out any relevant difference between the two. Laptop is connected via wifi and workstation via ethernet - don't think it matters, though.

Putting the following action as the first one solves the problem:

  - action: run
    description: fix DNS inside container
    script: /bin/ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf 

This is acceptable as workaround, but I'd say DNS stuff should be entirely handled by debos and not by any recipe.

Antonio

@gustavosbarreto
Copy link

Any news on this issue? I'm facing the same issue

@jeremiah
Copy link

This workaround might be best as an addition to the recipe because having "resolv.conf" in /run/systemd/resolve/ is not a universal distro standard. On Debian based distros for example resolv.conf ends up in /lib/systemd/resolv.conf as opposed to /run/systemd/resolve/resolv.conf. I imagine it will be hard to predict where it will end up for each value of ${distro}.

@ant9000
Copy link
Author

ant9000 commented Oct 31, 2019

I am using plain Debian, both as host and for the generated image, and the workaround I've suggested does work there - so I guess it won't be a distro problem.

But even if my recipe snippet works, I'd suggest that adding explicit resolution configuration to systemd-nspawn, via its --resolv-conf parameter, would be a cleaner way of obtaining the same result.

refi64 pushed a commit to refi64/debos that referenced this issue Jan 24, 2023
116: Misc test improvements r=obbardc a=obbardc

- Fix spelling in a unit test name
- Don't attempt to recover failed unit tests

Co-authored-by: Christopher Obbard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants