diff -uNrp samba-3.0.24.org/source/libsmb/namequery_dc.c samba-3.0.24.new/source/libsmb/namequery_dc.c
--- samba-3.0.24.org/source/libsmb/namequery_dc.c	2007-07-04 13:41:06.000000000 +0900
+++ samba-3.0.24.new/source/libsmb/namequery_dc.c	2007-07-05 13:32:12.000000000 +0900
@@ -76,6 +76,7 @@ static BOOL rpc_dc_name(const char *doma
 	struct in_addr dc_ip, exclude_ip;
 	int count, i;
 	NTSTATUS result;
+	BOOL search_dc = False;
 	
 	zero_ip(&exclude_ip);
 
@@ -86,21 +87,37 @@ static BOOL rpc_dc_name(const char *doma
 		return False;
 	}
 
-	/* Remove the entry we've already failed with (should be the PDC). */
+	if (lp_security() == SEC_SERVER){
+		fstring name;
+		const char *p;
+		p = lp_passwordserver();
+		if ( p != NULL ){
+			while (next_token(&p, name, LIST_SEP, sizeof(name))) {
+				if (strequal(name, "*")) {
+					DEBUG(5, ("Try to find the status of Domain Controler [%s]\n", domain));
+					search_dc = True;
+				}
+			}
+		}
+	} else {
+		search_dc = True;
+	}
 
-	for (i = 0; i < count; i++) {
-		if (is_zero_ip(ip_list[i].ip))
-			continue;
-
-		if (name_status_find(domain, 0x1c, 0x20, ip_list[i].ip, srv_name)) {
-			result = check_negative_conn_cache( domain, srv_name );
-			if ( NT_STATUS_IS_OK(result) ) {
-				dc_ip = ip_list[i].ip;
-				goto done;
+	/* Remove the entry we've already failed with (should be the PDC). */
+	if ( search_dc ){
+		for (i = 0; i < count; i++) {
+			if (is_zero_ip(ip_list[i].ip))
+				continue;
+			
+			if (name_status_find(domain, 0x1c, 0x20, ip_list[i].ip, srv_name)) {
+				result = check_negative_conn_cache( domain, srv_name );
+				if ( NT_STATUS_IS_OK(result) ) {
+					dc_ip = ip_list[i].ip;
+					goto done;
+				}
 			}
 		}
 	}
-	
 
 	SAFE_FREE(ip_list);
 
