diff options
author | Josh Stone <jistone@redhat.com> | 2014-12-03 16:01:33 -0800 |
---|---|---|
committer | Laine Stump <laine@laine.org> | 2015-01-20 01:07:18 -0500 |
commit | 298fa4858ced29e2c42681635a5a8dcd6da0b231 (patch) | |
tree | f792371f8b6a299b518e73e61b5fc2c569c36bba /tests/networkxml2confdata | |
parent | e11490e358e8d00877fe3fd2006238ecb315b347 (diff) | |
download | libvirt-298fa4858ced29e2c42681635a5a8dcd6da0b231.tar.gz |
network: Let domains be restricted to local DNS
This adds a new "localOnly" attribute on the domain element of the
network xml. With this set to "yes", DNS requests under that domain
will only be resolved by libvirt's dnsmasq, never forwarded upstream.
This was how it worked before commit f69a6b987d616, and I found that
functionality useful. For example, I have my host's NetworkManager
dnsmasq configured to forward that domain to libvirt's dnsmasq, so I can
easily resolve guest names from outside. But if libvirt's dnsmasq
doesn't know a name and forwards it to the host, I'd get an endless
forwarding loop. Now I can set localOnly="yes" to prevent the loop.
Signed-off-by: Josh Stone <jistone@redhat.com>
Diffstat (limited to 'tests/networkxml2confdata')
-rw-r--r-- | tests/networkxml2confdata/nat-network-dns-local-domain.conf | 14 | ||||
-rw-r--r-- | tests/networkxml2confdata/nat-network-dns-local-domain.xml | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/networkxml2confdata/nat-network-dns-local-domain.conf b/tests/networkxml2confdata/nat-network-dns-local-domain.conf new file mode 100644 index 0000000000..5f41b9186c --- /dev/null +++ b/tests/networkxml2confdata/nat-network-dns-local-domain.conf @@ -0,0 +1,14 @@ +##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 +local=/example.com/ +domain=example.com +expand-hosts +except-interface=lo +bind-dynamic +interface=virbr0 +addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts diff --git a/tests/networkxml2confdata/nat-network-dns-local-domain.xml b/tests/networkxml2confdata/nat-network-dns-local-domain.xml new file mode 100644 index 0000000000..a92d71f1f2 --- /dev/null +++ b/tests/networkxml2confdata/nat-network-dns-local-domain.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' /> + <domain name='example.com' localOnly='yes'/> + <ip address='192.168.122.1' netmask='255.255.255.0'> + </ip> +</network> |