[libvirt-users] Changing dnsmasq DNS settings for virtual machines

Johannes Kastl mail at ojkastl.de
Sun Apr 6 05:33:39 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everyone,

maybe this is an old fart, but I cant get it to work.

I am running libvirt on a laptop, where a dnsmasq is already running
to delegate dns info for my local (not-public) network. My resolv.conf
(on the host) lists the system-dnsmasq as first server.

I had to set the listen-adress for the system-dnsmasq to 127.0.0.1 and
set bind-interfaces, to stop if from binding to all interfaces and
overriding the libvirtd-dnsmasq, which also has dhcp enabled.

Now, how can I tell the libvirtd-dnsmasq, to use the system-dnsmasq as
first nameserver?

I found lots of pages when searching for "libvirt dns", but all of
them only show the dhcp-part of the network's xml file:

http://wiki.libvirt.org/page/VirtualNetworking#DNS_.26_DHCP
> <ip address="192.168.122.1" netmask="255.255.255.0"> <dhcp> <range
> start="192.168.122.100" end="192.168.122.254" /> <host
> mac="00:16:3e:e2:ed" name="foo.example.com" ip="192.168.122.10" /> 
> </dhcp> </ip>

One possible workaround:
My system-dnsmasq reads /etc/hosts_whatever, and apparently the
libvirtd-dnsmasq reads var/lib/libvirt/dnsmasq/NETWORK_NAME.addnhosts.
I could copy my hosts_whatever in that place, but I had to configure
the libvirtd-dnsmasq what my local domains are.

Which brings me to the next question:
How to set the addn-hosts= for the libvirtd-dnsmasq in the xml file?

Regards,
Johannes
- -- 
A good sermon should be like a woman's skirt: short enough to arouse
interest but long enough to cover the essentials.
(Ronald Knox)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/

iEYEARECAAYFAlNA5zMACgkQzi3gQ/xETbJBVACeLV9j/TDxgnImAsyEtotUBJ2J
OD0An2WDBWUoqCUvmoquk4pwoKplfu/T
=g6YM
-----END PGP SIGNATURE-----




More information about the libvirt-users mailing list