summaryrefslogtreecommitdiff
path: root/tests/networkxml2confdata
diff options
context:
space:
mode:
authorLaine Stump <laine@laine.org>2013-08-13 18:56:38 -0400
committerLaine Stump <laine@laine.org>2013-08-14 09:46:22 -0400
commit4f595ba61c792267dcd547a0e3c2887ab286e45b (patch)
tree4ad7815ac7f2b3090fafb0eaf44f0ece325246ec /tests/networkxml2confdata
parent11cdc424d30b15c6780d546a2f0d8ff93ce291b6 (diff)
downloadlibvirt-4f595ba61c792267dcd547a0e3c2887ab286e45b.tar.gz
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.
Diffstat (limited to 'tests/networkxml2confdata')
-rw-r--r--tests/networkxml2confdata/nat-network-dns-forward-plain.conf11
-rw-r--r--tests/networkxml2confdata/nat-network-dns-forward-plain.xml9
-rw-r--r--tests/networkxml2confdata/nat-network-dns-hosts.xml2
3 files changed, 21 insertions, 1 deletions
diff --git a/tests/networkxml2confdata/nat-network-dns-forward-plain.conf b/tests/networkxml2confdata/nat-network-dns-forward-plain.conf
new file mode 100644
index 0000000000..9a000b8879
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-forward-plain.conf
@@ -0,0 +1,11 @@
+##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+##OVERWRITTEN AND LOST. Changes to this configuration should be made using:
+## virsh net-edit default
+## or other application using the libvirt API.
+##
+## dnsmasq conf file created by libvirt
+strict-order
+except-interface=lo
+bind-dynamic
+interface=virbr0
+addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-forward-plain.xml b/tests/networkxml2confdata/nat-network-dns-forward-plain.xml
new file mode 100644
index 0000000000..10bacb5cbb
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-forward-plain.xml
@@ -0,0 +1,9 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid>
+ <forward dev='eth0' mode='nat'/>
+ <bridge name='virbr0' stp='on' delay='0' />
+ <dns forwardPlainNames='yes'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ </ip>
+</network>
diff --git a/tests/networkxml2confdata/nat-network-dns-hosts.xml b/tests/networkxml2confdata/nat-network-dns-hosts.xml
index 2180a5ddcd..351df4fb57 100644
--- a/tests/networkxml2confdata/nat-network-dns-hosts.xml
+++ b/tests/networkxml2confdata/nat-network-dns-hosts.xml
@@ -4,7 +4,7 @@
<forward dev='eth0' mode='nat'/>
<bridge name='virbr0' stp='on' delay='0' />
<domain name="example.com"/>
- <dns>
+ <dns forwardPlainNames='no'>
<host ip='192.168.122.1'>
<hostname>host</hostname>
<hostname>gateway</hostname>