On Tue, Oct 25, 2011 at 07:26:11PM +0200, Christoph Wickert wrote:
Hi,
I'd like to give my VMs reliable addresses over DHCP and so far I was only able to do this by defining them in the libvirt's network config with 'virsh net-edit'. But as libvirt runs dnsmasq and dnsmasq usually reads /etc/hosts, it should be sufficient to just edit the hosts file.
Unfortunately this doesn't work. Why does dnsmasq ignore /etc/hosts when started from libvirt?
As far as I can tell, dnsmasq should be reading /etc/hosts. Here is how libvirt starts dnsmasq:
/usr/sbin/dnsmasq --strict-order --bind-interfaces \ --pid-file=/var/run/libvirt/network/default.pid --conf-file= \ --except-interface lo --listen-address 192.168.122.1 --dhcp-range \ 192.168.122.2,192.168.122.254 \ --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases \ --dhcp-lease-max=253 --dhcp-no-override
Anyhow, the dnsmasq instance is private to libvirt. If you want to use features from dnsmasq, ask for them to be added to the libvirt XML (on libvir-list).
Rich.