mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
network: allow disabling dnsmasq's DNS server
If you define a libvirt virtual network with one or more IP addresses, it starts up an instance of dnsmasq. It's always been possible to avoid dnsmasq's dhcp server (simply don't include a <dhcp> element), but until now it wasn't possible to avoid having the DNS server listening; even if the network has no <dns> element, it is started using default settings. This patch adds a new attribute to <dns>: enable='yes|no'. For backward compatibility, it defaults to 'yes', but if you don't want a DNS server created for the network, you can simply add: <dns enable='no'/> to the network configuration, and next time the network is started there will be no dns server created (if there is dhcp configuration, dnsmasq will be started with "port=0" which disables the DNS server; if there is no dhcp configuration, dnsmasq won't be started at all).
This commit is contained in:
11
tests/networkxml2confdata/routed-network-no-dns.conf
Normal file
11
tests/networkxml2confdata/routed-network-no-dns.conf
Normal file
@@ -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 local
|
||||
## or other application using the libvirt API.
|
||||
##
|
||||
## dnsmasq conf file created by libvirt
|
||||
strict-order
|
||||
port=0
|
||||
except-interface=lo
|
||||
bind-dynamic
|
||||
interface=virbr1
|
||||
10
tests/networkxml2confdata/routed-network-no-dns.xml
Normal file
10
tests/networkxml2confdata/routed-network-no-dns.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<network>
|
||||
<name>local</name>
|
||||
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
|
||||
<bridge name="virbr1"/>
|
||||
<mac address='12:34:56:78:9A:BC'/>
|
||||
<forward mode="route" dev="eth1"/>
|
||||
<dns enable='no'/>
|
||||
<ip address="192.168.122.1" netmask="255.255.255.0">
|
||||
</ip>
|
||||
</network>
|
||||
Reference in New Issue
Block a user