Customize dnsmasq

I want to run dnsmasq with the --dhcp-ignore-names option. The reason is that I’m provisioning containers with Ansible through a specific interface (the one asking IP via DHCP), bur I need the hostname to resolve to one of the statically configured interfaces, but if dnsmasq does not ignore the names, it resolves them to the DHCP IPs.

To make sure this worked, I simply killed the dnsmasq server started by lxc network create and run it with the same options plus --dhcp-ignore-names and it worked.

Is there a way, or should I open a bug request?

There is a raw.dnsmasq config option to let you set arbitrary dnsmasq options.

The parameter is part of the config file or a CLI option?

The CLI just modifies the database config, so both?

You can set that key with lxc network set or lxc network edit or even pass it during lxc network create.

My question was more like: is the string value for the raw.dnsmasq a piece of configuration file or part of dnsmasq's command line? It’s not the same to write --dhcp-ignore-names than to write dhcp-ignore-names.

Answering myself: it’s the contents of /var/snap/lxd/common/lxd/networks/lxcbr0/dnsmasq.raw. It would be nice if the docs had this detail.