diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 0b43a67e8c..43f2ae274e 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -710,9 +710,6 @@ networkDnsmasqConfContents(virNetworkObjPtr network, "strict-order\n", network->def->name); - if (!network->def->dns.forwardPlainNames) - virBufferAddLit(&configbuf, "domain-needed\n"); - if (network->def->dns.forwarders) { virBufferAddLit(&configbuf, "no-resolv\n"); for (i = 0; i < network->def->dns.nfwds; i++) { @@ -728,14 +725,13 @@ networkDnsmasqConfContents(virNetworkObjPtr network, network->def->domain); } - if (network->def->domain || !network->def->dns.forwardPlainNames) { - /* need to specify local even if no domain specified, unless - * the config says we should forward "plain" names (i.e. not - * fully qualified, no '.' characters) + if (!network->def->dns.forwardPlainNames) { + virBufferAddLit(&configbuf, "domain-needed\n"); + /* need to specify local=// whether or not a domain is + * specified, unless the config says we should forward "plain" + * names (i.e. not fully qualified, no '.' characters) */ - virBufferAsprintf(&configbuf, - "local=/%s/\n", - network->def->domain ? network->def->domain : ""); + virBufferAddLit(&configbuf, "local=//\n"); } if (pidfile) diff --git a/tests/networkxml2confdata/dhcp6-network.conf b/tests/networkxml2confdata/dhcp6-network.conf index 5fde07fbd1..92ea2a4caa 100644 --- a/tests/networkxml2confdata/dhcp6-network.conf +++ b/tests/networkxml2confdata/dhcp6-network.conf @@ -5,10 +5,10 @@ ## ## dnsmasq conf file created by libvirt strict-order -domain-needed domain=mynet expand-hosts -local=/mynet/ +domain-needed +local=// except-interface=lo bind-dynamic interface=virbr0 diff --git a/tests/networkxml2confdata/nat-network-dns-forwarders.conf b/tests/networkxml2confdata/nat-network-dns-forwarders.conf index ebca289575..5f95f77b02 100644 --- a/tests/networkxml2confdata/nat-network-dns-forwarders.conf +++ b/tests/networkxml2confdata/nat-network-dns-forwarders.conf @@ -5,10 +5,10 @@ ## ## dnsmasq conf file created by libvirt strict-order -domain-needed no-resolv server=8.8.8.8 server=8.8.4.4 +domain-needed local=// except-interface=lo bind-dynamic diff --git a/tests/networkxml2confdata/nat-network-dns-hosts.conf b/tests/networkxml2confdata/nat-network-dns-hosts.conf index 2577882958..021316f9c7 100644 --- a/tests/networkxml2confdata/nat-network-dns-hosts.conf +++ b/tests/networkxml2confdata/nat-network-dns-hosts.conf @@ -5,10 +5,10 @@ ## ## dnsmasq conf file created by libvirt strict-order -domain-needed domain=example.com expand-hosts -local=/example.com/ +domain-needed +local=// except-interface=lo bind-dynamic interface=virbr0 diff --git a/tests/networkxml2confdata/netboot-network.conf b/tests/networkxml2confdata/netboot-network.conf index b6f3c23f15..ce33176e15 100644 --- a/tests/networkxml2confdata/netboot-network.conf +++ b/tests/networkxml2confdata/netboot-network.conf @@ -5,10 +5,10 @@ ## ## dnsmasq conf file created by libvirt strict-order -domain-needed domain=example.com expand-hosts -local=/example.com/ +domain-needed +local=// except-interface=lo bind-interfaces listen-address=192.168.122.1 diff --git a/tests/networkxml2confdata/netboot-proxy-network.conf b/tests/networkxml2confdata/netboot-proxy-network.conf index 1e969fac6b..f4d3880210 100644 --- a/tests/networkxml2confdata/netboot-proxy-network.conf +++ b/tests/networkxml2confdata/netboot-proxy-network.conf @@ -5,10 +5,10 @@ ## ## dnsmasq conf file created by libvirt strict-order -domain-needed domain=example.com expand-hosts -local=/example.com/ +domain-needed +local=// except-interface=lo bind-interfaces listen-address=192.168.122.1