diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py index 8d692e0054f1..de183777cf55 100644 --- a/nova/network/linux_net.py +++ b/nova/network/linux_net.py @@ -1103,6 +1103,7 @@ def restart_dhcp(context, dev, network_ref, fixedips): '--dhcp-lease-max=%s' % len(netaddr.IPNetwork(network_ref['cidr'])), '--dhcp-hostsfile=%s' % _dhcp_file(dev, 'conf'), '--dhcp-script=%s' % CONF.dhcpbridge, + '--no-hosts', '--leasefile-ro'] # dnsmasq currently gives an error for an empty domain, @@ -1116,8 +1117,6 @@ def restart_dhcp(context, dev, network_ref, fixedips): dns_servers.add(network_ref.get('dns1')) if network_ref.get('dns2'): dns_servers.add(network_ref.get('dns2')) - if network_ref['multi_host'] or dns_servers: - cmd.append('--no-hosts') if network_ref['multi_host']: cmd.append('--addn-hosts=%s' % _dhcp_file(dev, 'hosts')) if dns_servers: diff --git a/nova/tests/network/test_linux_net.py b/nova/tests/network/test_linux_net.py index 12264dd7489b..e0778477ab68 100644 --- a/nova/tests/network/test_linux_net.py +++ b/nova/tests/network/test_linux_net.py @@ -675,6 +675,7 @@ class LinuxNetworkTestCase(test.NoDBTestCase): '--dhcp-lease-max=256', '--dhcp-hostsfile=%s' % linux_net._dhcp_file(dev, 'conf'), '--dhcp-script=%s' % CONF.dhcpbridge, + '--no-hosts', '--leasefile-ro'] if CONF.dhcp_domain: @@ -690,7 +691,6 @@ class LinuxNetworkTestCase(test.NoDBTestCase): def test_dnsmasq_execute_dns_servers(self): self.flags(dns_server=['1.1.1.1', '2.2.2.2']) expected = [ - '--no-hosts', '--no-resolv', '--server=1.1.1.1', '--server=2.2.2.2', @@ -700,7 +700,6 @@ class LinuxNetworkTestCase(test.NoDBTestCase): def test_dnsmasq_execute_use_network_dns_servers(self): self.flags(use_network_dns_servers=True) expected = [ - '--no-hosts', '--no-resolv', '--server=8.8.4.4', ]