In a previous installment we configured systemd-networkd and lxc to play nicely together, along with docker. There was one problem with that setup, which is that the host could not find containers by name. This post addresses that.

### LXC_DOMAIN

On Archlinux at least, LXC_DOMAIN is empty by default. It’s a good idea to set this to something to help segregate the LXC containers. I used .lxc, even though I probably shouldn’t

### systemd-networkd to the rescue

In the previous post, I had mentioned that switching to systemd-networkd was probably just yak shaving. It pays off now though, as it makes handling upstream DNS a lot simpler with dnsmasq. First off, make sure that /etc/resolv.conf is a normal file, and not symlinked to /run/systemd/resolve/resolv.conf as most guides suggest.

Next, update dnsmasq.conf and add the following line:

resolv-file=/run/systemd/resolve/resolv.conf


nameserver 10.0.3.1