Johannes Kastl
2014-Apr-13 19:23 UTC
Re: [libvirt-users] Changing dnsmasq DNS settings for virtual machines
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Laine, thanks for the answer. On 13.04.14 16:13 Laine Stump wrote:> There is no provision for that. If you want additional hosts to be > known by the libvcirt instance of dnsmasq, you must enter them into > the xml.I can set the addn-hosts in the .conf file in /var/lib/libvirt/dnsmasq/<nameofthenetwork>.conf. I was just not sure if this gets overwritten, each time I change a setting in the network's xml (virsh net-edit ...).> If we allowed pointing to an existing addn-hosts file written by > the user, we would be adding the format of dnsmasq's addn-hosts > file to libvirt's official API, which we don't want to do - we want > to keep libvirt's API as implementation-agnostic as possible (in > case someone implements a libvirt network driver that uses > something other than dnsmasq for DNS, for example).Sounds reasonable. Regards, Johannes - -- Osama bin Laden might wish to destroy America, but America is too big for him; he cannot do it. Bush may really do it. (Richard M. Stallman) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/ iEYEARECAAYFAlNK5CUACgkQzi3gQ/xETbItiACgjNozwILNWIul24L/uac+gSbo UK0AoJPBUfDvgwutDSAYFcLv+gib9JXL =vsiW -----END PGP SIGNATURE-----
Laine Stump
2014-Apr-14 09:23 UTC
Re: [libvirt-users] Changing dnsmasq DNS settings for virtual machines
On 04/13/2014 10:23 PM, Johannes Kastl wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Laine, > > thanks for the answer. > > On 13.04.14 16:13 Laine Stump wrote: > >> There is no provision for that. If you want additional hosts to be >> known by the libvcirt instance of dnsmasq, you must enter them into >> the xml. > I can set the addn-hosts in the .conf file in > /var/lib/libvirt/dnsmasq/<nameofthenetwork>.conf.Yes, you can change that file, but: 1) the location and contents of that file are not a part of the official libvirt API, and are subject to change at any time, 2) The file is only read by dnsmasq immediately after it has been created, when dnsmasq first starts. 3) dnsmasq runs as user nobody, so it isn't even possible to force it to reread that file by sending a SIGHUP. So, changing the contents of the conf file does you no good (or at least it *shouldn't* do you any good)> I was just not sure if this gets overwritten, each time I change a > setting in the network's xml (virsh net-edit ...).It is rewritten from scratch based on the network's config each time you re-start the network.
Johannes Kastl
2014-Apr-14 19:11 UTC
Re: [libvirt-users] Changing dnsmasq DNS settings for virtual machines
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Laine, thanks for the fast answer. On 14.04.14 11:23 Laine Stump wrote:> On 04/13/2014 10:23 PM, Johannes Kastl wrote:[/var/lib/libvirt/dnsmasq/<nameofthenetwork>.conf]>> I was just not sure if this gets overwritten, each time I change >> a setting in the network's xml (virsh net-edit ...). > > It is rewritten from scratch based on the network's config each > time you re-start the network.I first wanted to write, how sub-optimal that is. How libvirt could at least check, if the user made manual changes to that file. How this feels like curtailing libvirt without the need to do so, as at the moment no other tool apart from dnsmasq is used. Then I contemplated a little, and had to change my opinon. Of course things like that would be nice, but setting a forwarder in the xml solves all/most of my problems, so I do not need to set the addn-hosts. And, to state it clearly, thank all of you for libvirt. I love it. I am so glad I discovered it, and also discovered that it runs that smooth. Regards, Johannes P.S.: Sorry if this mail (or a similar mail) gets sent twice, sending offline somehow triggered a bug in my SeaMonkey... - -- I don't want to achieve immortality through my work. I want to achieve immortality through not dying. (Woody Allen) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/ iEYEARECAAYFAlNMMvEACgkQzi3gQ/xETbLseACePi/GNPZtbXr63tg0E/Imik5h 6mIAnAzqbyYauX1IdxnHUJrTdeLxWlzE =BNwn -----END PGP SIGNATURE-----
Seemingly Similar Threads
- Re: Changing dnsmasq DNS settings for virtual machines
- Re: Changing dnsmasq DNS settings for virtual machines
- Re: Changing dnsmasq DNS settings for virtual machines
- Re: Changing dnsmasq DNS settings for virtual machines
- Changing dnsmasq DNS settings for virtual machines