I have mounted a server with LXD 3.19 and I need to know how to assign the name and domain search servers at the bridge level (from which all the containers hang), I understand that it works via dnsmasq but I do not quite know how to do it because although I add it by hand in the file /etc/resolv.conf but every x time it resets and breaks all the service of the containers.
well the host name is by default the container name.
When you use the default LXD config (lxdbr0 and dnsmasq) the containers get their names from their own config and these names are reflected in the dns (dnsmasq).
If you use the default LXD configuration the containers resolve their names without using the resolv.conf of the host in any way, that is a container c1 can ping a container c2 without any use of this resolv.conf file.
The problem is that since the machine hosts the containers I lose the configuration of the file /etc/resolv.conf, therefore the containers lose the possibility of resolving the names from outside (other physical servers of the company etc …)
With default LXD configuration, the LXD dns server (dnsmasq) uses the host default resolution configuration to ask for names it does not know by itself (that is, every host in the world except the containers it is managing).
When using default LXD config, it works pretty fine and any container can ping, say, www.google.com without problem.
If from the host you can’t ping the other computers, LXD dnsmasq will not be able to do that even with default LXD configuration.
Edit: the hosts file of the host can be a special case and you should test using the dig tool.
I have no idea. Local resolution is a complex matter and vary from a distro to another and even with the configuration options. Personally I never edit resolv.conf and it always has the same content (it’s set by systemd resolver). Without you being more specific it’s not possible to go further, I have not great urge to speculate on a million different use cases.