diff --git a/vmware_nsx/common/config.py b/vmware_nsx/common/config.py index 9fd1772f28..5e41dfcc2e 100644 --- a/vmware_nsx/common/config.py +++ b/vmware_nsx/common/config.py @@ -377,6 +377,11 @@ nsxv_opts = [ "router. This edge_appliance_size will be picked up if " "--router-size parameter is not specified while doing " "neutron router-create")), + cfg.ListOpt('nameservers', + default=[], + help=_('List of nameservers to configure for the DHCP binding ' + 'entries. These will be used if there are no ' + 'nameservers defined on the subnet.')), ] # Register the configuration options diff --git a/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py b/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py index 95ec4b31a4..5bb29f8ddd 100644 --- a/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py +++ b/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py @@ -717,6 +717,9 @@ class EdgeManager(object): # set primary and secondary dns name_servers = [dns['address'] for dns in subnet['dns_nameservers']] + # if no nameservers have been configured then use the ones + # defined in the configuration + name_servers = name_servers or cfg.CONF.nsxv.nameservers if len(name_servers) == 1: static_config['primaryNameServer'] = name_servers[0] elif len(name_servers) >= 2: