diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 8763a51270..ce7c3a5160 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -3391,14 +3391,18 @@ static gboolean _set_fcn_ip_config_dns_options (ARGS_SET_FCN) { gs_free const char **strv = NULL; + NMSettingIPConfig *s_ip; gsize i; nm_assert (!error || !*error); + s_ip = NM_SETTING_IP_CONFIG (setting); strv = nm_utils_strsplit_set (value, " \t,", FALSE); if (strv) { - for (i = 0; strv[i]; i++) - nm_setting_ip_config_add_dns_option (NM_SETTING_IP_CONFIG (setting), strv[i]); + for (i = 0; strv[i]; i++) { + nm_setting_ip_config_remove_dns_option_by_value (s_ip, strv[i]); + nm_setting_ip_config_add_dns_option (s_ip, strv[i]); + } } return TRUE; }