diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c
index 490a4cd..d157ffd 100644
--- a/src/dns-manager/nm-dns-manager.c
+++ b/src/dns-manager/nm-dns-manager.c
@@ -675,31 +675,32 @@ update_dns (NMDnsManager *self,
 	rc.nis_domain = NULL;
 	rc.nis_servers = g_ptr_array_new ();
 
+	if (priv->ip6_vpn_config)
+		merge_one_ip6_config (&rc, priv->ip6_vpn_config);
+	if (priv->ip6_device_config)
+		merge_one_ip6_config (&rc, priv->ip6_device_config);
+
 	if (priv->ip4_vpn_config)
 		merge_one_ip4_config (&rc, priv->ip4_vpn_config);
 	if (priv->ip4_device_config)
 		merge_one_ip4_config (&rc, priv->ip4_device_config);
 
-	if (priv->ip6_vpn_config)
-		merge_one_ip6_config (&rc, priv->ip6_vpn_config);
-	if (priv->ip6_device_config)
-		merge_one_ip6_config (&rc, priv->ip6_device_config);
 
 	for (iter = priv->configs; iter; iter = g_slist_next (iter)) {
-		if (   (iter->data == priv->ip4_vpn_config)
-		    || (iter->data == priv->ip4_device_config)
-		    || (iter->data == priv->ip6_vpn_config)
-		    || (iter->data == priv->ip6_device_config))
+		if (   (iter->data == priv->ip6_vpn_config)
+		    || (iter->data == priv->ip6_device_config)
+		    || (iter->data == priv->ip4_vpn_config)
+		    || (iter->data == priv->ip4_device_config))
 			continue;
 
-		if (NM_IS_IP4_CONFIG (iter->data)) {
-			NMIP4Config *config = NM_IP4_CONFIG (iter->data);
-
-			merge_one_ip4_config (&rc, config);
-		} else if (NM_IS_IP6_CONFIG (iter->data)) {
+		if (NM_IS_IP6_CONFIG (iter->data)) {
 			NMIP6Config *config = NM_IP6_CONFIG (iter->data);
 
 			merge_one_ip6_config (&rc, config);
+		} else if (NM_IS_IP4_CONFIG (iter->data)) {
+			NMIP4Config *config = NM_IP4_CONFIG (iter->data);
+
+			merge_one_ip4_config (&rc, config);
 		} else
 			g_assert_not_reached ();
 	}
