[systemd-devel] Networking in a systemd-nspawn container

Jarosław Fedewicz jaroslaw.fedewicz at gmail.com
Fri Nov 19 00:29:47 UTC 2021


> I have been wondering: Would it be possible to forward the containers
> resolver to the host machine resolver somehow?

On my laptop's host system, I set NetworkManager to use dnsmasq as the DNS
server. I added a config file snippet to that dnsmasq so it also listens on
my bridge interface (which has a static IP address, and the containers are
on the same internal network with it and are using it as their default
route). Then I set the resolver in my containers to use the IP from the
host side of the bridge as their DNS.

Of course this is not a thing that I imagine systemd-nspawn would do all by
itself. It feels too complicated. I think the feature exists in its current
form because it was simple to implement and would cover maybe 85% of the
use cases.

But then again, could systemd-nspawn and systemd-resolved somehow be made
to work in tandem to provide an automagical solution?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20211119/82ea4a59/attachment.htm>


More information about the systemd-devel mailing list