1
I have upgraded my Ubuntu Desktop to Bionic Beaver, which switched to systemd-resolve. With that change, the LXD DNS resolution stopped working.
In order to make LXD containers discoverable, I can run the below command. Note, the IP 10.78.38.1 is the IP of the lxdbr0 bridge.
$ sudo systemd-resolve --interface lxdbr0 --set-dns 10.78.38.1 --set-domain lxd
With this in place, I can discover LXD container by their name and the configuration looks as follows.
$ systemd-resolve --status
.
.
.
Link 10 (lxdbr0)
Current Scopes: DNS
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 10.78.38.1
DNS Domain: lxd
.
.
.
However, after a system reboot, this configuration is gone.
$ systemd-resolve --status
.
.
.
Link 10 (lxdbr0)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
.
.
.
In order to make the above persistent, I have reviewed the systemd-resolve manpage http://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html. It suggests to create a /etc/systemd/resolved.conf.d/lxd.conf file but there are no parameters available that would allow me to make such configuration specific to one particular NIC.
This sounds plausible but this setting does not seem to have any effect on my system with LXD. After posting the initial question, I had created a Systemd service that executes the aforementioned command in order to configure DNS for LXD, which runs on boot. That does not reliably work either, since the lxdbr0 interface sometimes does not exist yet at that point in time. I therefore have to start the custom Systemd service manually. I guess, this might also be the reason for your solution not to work with LXD although it appears to be the right way to go... – quat – 2018-10-12T11:01:02.543
You are right. But somehow I managed to get the desired output from
systemd-resolve --status
without entering that command. The other problem is, that name resolving does not work inside containers. I will fix my answer, if I find a better solution. – ctx – 2018-10-12T11:57:20.207