My problem was that on Ubuntu Desktop 18.04, and with LXD installed from snap, I could not get this command to work:
$ host my-container-name.lxd
…because my-container-name.lxd wouldn’t resolve.
I found this solution to my problem:
-
edit /etc/NetworkManager/NetworkManager.conf, and in the section [main] add this line:
dns=dnsmasq
(I believe this line says that systemd-resolved.service will not be used anymore) -
remove the file /etc/resolv.conf
-
execute
systemctl restart NetworkManager
-
Run ifconfig to find the IP address of lxdbr0 (suppose for now that it is 10.8.7.1)
-
create or edit the file /etc/NetworkManager/dnsmasq.d/lxd.conf, and insert this line:
server=/lxd/10.8.7.1
(replace the number 10.8.7.1 with whatever you found in step 4) -
Reboot the PC
Do you see something bad in this solution? Do you think it could cause problems to my computer?
Thanks