How to configure dnsmasq per network?

Hi there,

local dns mappings can be set in /etc/hosts on the host in order to resolve them in containers.

Is there an intended way to configure the per-network dnsmaq-daemon? I’d like to set dns-name/ip-address mappings different for each of my incus-networks. (…and without the need to restart the network on change)

Thanks and kind regards,

Florian

Hi!

dnsmasq has the --addn-hosts=<file> parameter that you can use to specify an additional file to the host’s /etc/hosts.

Then, send the SIGHUP signal to the dnsmasq process which will quite likely reload that additional hosts file.