Index: /branches/rel_apv_10_4_2_104_webagent_dns/usr/click/tools/name_services.pl
===================================================================
--- /branches/rel_apv_10_4_2_104_webagent_dns/usr/click/tools/name_services.pl	(revision 38652)
+++ /branches/rel_apv_10_4_2_104_webagent_dns/usr/click/tools/name_services.pl	(working copy)
@@ -49,6 +49,29 @@
 		die "3 name servers already defined\n";
 	}
 	print RESOLV "nameserver $ARGV[1]\n";
+
+        seek(RESOLV, 0, 0);
+
+        # Selectivly change timeout to 1
+        # Shove the whole file into an array
+        my @input_buff = <RESOLV>;
+        my @output_buff = (); #This array used to store the unmatched lines
+        foreach my $line (@input_buff ) {
+                if ($line =~ (/^options timeout:(\S+)/)) {
+                         # Timeout needs to be after servers or dns does not work
+                         # so remove any timeout we find, we will insert time out after the servers
+                } else {
+                         push(@output_buff, $line); #append this line to array output_buf
+                }
+        }
+        push(@output_buff, "options timeout:1\n");
+
+        # Truncate the file to clean
+        truncate(RESOLV, 0);
+        # Send the output_buff content to file
+        print RESOLV @output_buff;
+        seek(RESOLV, 0, 0);
+
 	flock(RESOLV,LOCK_UN);
 	close(RESOLV);
 exit;
