]> xenbits.xensource.com Git - libvirt.git/commit
network: permit upstream forwarding of unqualified DNS names
authorLaine Stump <laine@laine.org>
Tue, 13 Aug 2013 22:56:38 +0000 (18:56 -0400)
committerLaine Stump <laine@laine.org>
Wed, 14 Aug 2013 13:46:22 +0000 (09:46 -0400)
commit4f595ba61c792267dcd547a0e3c2887ab286e45b
tree4ad7815ac7f2b3090fafb0eaf44f0ece325246ec
parent11cdc424d30b15c6780d546a2f0d8ff93ce291b6
network: permit upstream forwarding of unqualified DNS names

This resolves the issue that prompted the filing of

  https://bugzilla.redhat.com/show_bug.cgi?id=928638

(although the request there is for something much larger and more
general than this patch).

commit f3868259ca0517212e439a65c9060868f673b6c9 disabled the
forwarding to upstream DNS servers of unresolved DNS requests for
names that had no domain, but were just simple host names (no "."
character anywhere in the name). While this behavior is frowned upon
by DNS root servers (that's why it was changed in libvirt), it is
convenient in some cases, and since dnsmasq can be configured to allow
it, it must not be strictly forbidden.

This patch restores the old behavior, but since it is usually
undesirable, restoring it requires specification of a new option in
the network config. Adding the attribute "forwardPlainNames='yes'" to
the <dns> elemnt does the trick - when that attribute is added to a
network config, any simple hostnames that can't be resolved by the
network's dnsmasq instance will be forwarded to the DNS servers listed
in the host's /etc/resolv.conf for an attempt at resolution (just as
any FQDN would be forwarded).

When that attribute *isn't* specified, unresolved simple names will
*not* be forwarded to the upstream DNS server - this is the default
behavior.
13 files changed:
docs/formatnetwork.html.in
docs/schemas/network.rng
src/conf/network_conf.c
src/conf/network_conf.h
src/network/bridge_driver.c
tests/networkxml2confdata/nat-network-dns-forward-plain.conf [new file with mode: 0644]
tests/networkxml2confdata/nat-network-dns-forward-plain.xml [new file with mode: 0644]
tests/networkxml2confdata/nat-network-dns-hosts.xml
tests/networkxml2conftest.c
tests/networkxml2xmlin/nat-network-dns-forward-plain.xml [new file with mode: 0644]
tests/networkxml2xmlin/nat-network-dns-hosts.xml
tests/networkxml2xmlout/nat-network-dns-forward-plain.xml [new file with mode: 0644]
tests/networkxml2xmltest.c