LXD and DNSMASQ conflict

On my Ubuntu 20.04 VPS I have DNSMASQ up and running. When I tried to install LXD I found that LXD’s bundled DNSMASQ conflicts with already installed, so they simply don’t work together, so there is no networking inside LXD. For some reasons I can not uninstall DNSMASQ from host, so I have a couple of questions

  1. Is there a way to configure LXD’s DNSMASQ to work system-wide? or
  2. does it means that I should create bridge interface for LXD manually and serve it with host’s DNSMASQ?

By default LXD’s dnsmasq is configured to only listen on the associated bridge interface it will be used with, usually lxdbr0.

Therefore if you have an existing service that is listening on the wildcard address or all interfaces, then it will prevent LXD’s dnsmasq from starting, or vice versa if it is already running.

You could configure your existing conflicting service to only listen on the interfaces you require it on and not lxdbr0 which should resolve the conflict.

You could do option 2 also, but you would also need to reconfigure your existing dnsmasq service to specify which subnet to allocate for that interface.

So either way you need to reconfigure your existing dnsmasq service, and I would suggest the former option to allow LXD to manage its own dnsmasq.

Oh. My bad.

Setting except-interface=lxdbr0 in dnsmasq.conf solved the issue