How to enable hostname resolution (dns) for lxd containers from the lxd host?

Solution 1:

LXD sets up for you a DHCP & DNS server (dnsmasq) that only listens on the lxdbr0 interface. That's the DHCP server that lets containers have hostnames like c1.lxd, mycontainer.lxd and so on. And it works only within the containers, because the containers are autoconfigured with that LXD's DNS server.

If you want the host to understand those c1.lxd, mycontainer.lxd hostnames, you need to configure your host's DNS client service to also consult LXD's DNS server.