Access LXD guests by name from host

I have a solution to the problem of accessing LXD guests by name from the host. At least on bionic, which what I am currently running, the system resolver is systemd-resolved which can be configured to listen on different interfaces and to query different servers.

sudo systemd-resolve --interface lxdbr0 --set-dns 10.x.x.1 --set-domain lxd

Everything else stays as is. Now querying for a guest by name will return its IPv4 and IPv6 addresses.

The only remaining question is where to put that to make it permanent. I think the best place would at the end of the process setting up lxdbr0, but I’ve no clue how to do that.

Thanks

Someone please answer to this guy. This information looks useful.

1 Like

You would need to create a network configuration file for the lxdbr0 interface, then specify there the DNS and Domain suffix.

I blogged about this at

:smiley:

Thanks. Perfect.

And a great many thanks to Alexander for pressing the issue. :sunny: