Johannes Kastl
2014-Apr-10 17:12 UTC
Re: [libvirt-users] Changing dnsmasq DNS settings for virtual machines
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 10.04.2014 13:08 Laine Stump wrote:> On 04/06/2014 08:33 AM, Johannes Kastl wrote:>> There was a bug in libvirt for quite awhile that caused >> locally-unresolved requests for hostnames in the domain given by >> the network's <domain name='xyzzy'/> element to be dropped rather >> than forwarded. Is that possibly the cause of your problems?Maybe...>> Alternately, since 1.1.3 you can tell dnsmasq to forward to a >> specific address rather than the one listed in /etc/resolv.conf >> with the <forwarder> subelement of the <dns> element in the >> network definition, e.g.: > >> <dns> <forwarder addr='1.2.3.4'/> </dns>Nice, seems to work.>> This is documented here: > >> http://www.libvirt.org/formatnetwork.html#elementsAddressI actually was on that page, but I must have missed that bit...> Which brings me to the next question: How to set the addn-hosts> for the libvirtd-dnsmasq in the xml file? > >> You do that with the <host> subelement of the <dns> element. An >> example is at the same link as above.No, thats not it. I do not want to set single hosts, I want to tell dnsmasq to read an additional hosts-file. In the normal dnsmasq.conf this is done via addn-hosts=, and that appears in the conf-file for the network called e.g. WHATEVER: addn-hosts=/var/lib/libvirt/dnsmasq/WHATEVER.addnhosts Regards, Johannes - -- 'Are you Death?' ... IT'S THE SCYTHE, ISN'T IT? PEOPLE ALWAYS NOTICE THE SCYTHE. (Terry Pratchett, The Fifth Elephant) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/ iEYEARECAAYFAlNG0OwACgkQzi3gQ/xETbLqJQCghnq19VVAhUJyhfvzfr+D5JyJ aDwAnAgUDw+eSXC5rL1O9UL7MWPSemn3 =lSGE -----END PGP SIGNATURE-----
Laine Stump
2014-Apr-13 14:13 UTC
Re: [libvirt-users] Changing dnsmasq DNS settings for virtual machines
On 04/10/2014 08:12 PM, Johannes Kastl wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 10.04.2014 13:08 Laine Stump wrote: >> On 04/06/2014 08:33 AM, Johannes Kastl wrote: >>> There was a bug in libvirt for quite awhile that caused >>> locally-unresolved requests for hostnames in the domain given by >>> the network's <domain name='xyzzy'/> element to be dropped rather >>> than forwarded. Is that possibly the cause of your problems? > Maybe... > >>> Alternately, since 1.1.3 you can tell dnsmasq to forward to a >>> specific address rather than the one listed in /etc/resolv.conf >>> with the <forwarder> subelement of the <dns> element in the >>> network definition, e.g.: >>> <dns> <forwarder addr='1.2.3.4'/> </dns> > Nice, seems to work. > >>> This is documented here: >>> http://www.libvirt.org/formatnetwork.html#elementsAddress > I actually was on that page, but I must have missed that bit... > >> Which brings me to the next question: How to set the addn-hosts>> for the libvirtd-dnsmasq in the xml file? >> >>> You do that with the <host> subelement of the <dns> element. An >>> example is at the same link as above. > No, thats not it. I do not want to set single hosts, I want to tell > dnsmasq to read an additional hosts-file.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. 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).> In the normal dnsmasq.conf > this is done via addn-hosts=, and that appears in the conf-file for > the network called e.g. WHATEVER: > > addn-hosts=/var/lib/libvirt/dnsmasq/WHATEVER.addnhosts >
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-----
Seemingly Similar Threads
- Re: Changing dnsmasq DNS settings for virtual machines
- 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