bc5dde
diff -up bind-9.7.2b1/bin/dig/dighost.c.rh570851 bind-9.7.2b1/bin/dig/dighost.c
bc5dde
--- bind-9.7.2b1/bin/dig/dighost.c.rh570851	2010-08-10 12:55:14.219403986 +0200
bc5dde
+++ bind-9.7.2b1/bin/dig/dighost.c	2010-08-10 12:56:40.716015777 +0200
bc5dde
@@ -126,7 +126,8 @@ isc_boolean_t
bc5dde
 	usesearch = ISC_FALSE,
bc5dde
 	showsearch = ISC_FALSE,
bc5dde
 	qr = ISC_FALSE,
bc5dde
-	is_dst_up = ISC_FALSE;
bc5dde
+	is_dst_up = ISC_FALSE,
bc5dde
+	verbose = ISC_FALSE;
bc5dde
 in_port_t port = 53;
bc5dde
 unsigned int timeout = 0;
bc5dde
 unsigned int extrabytes;
bc5dde
@@ -1240,10 +1241,24 @@ setup_system(void) {
bc5dde
 		}
bc5dde
 	}
bc5dde
 
bc5dde
+	if (lwconf->resdebug) {
bc5dde
+		verbose = ISC_TRUE;
bc5dde
+		debug("verbose is on");
bc5dde
+	}
bc5dde
 	if (ndots == -1) {
bc5dde
 		ndots = lwconf->ndots;
bc5dde
 		debug("ndots is %d.", ndots);
bc5dde
 	}
bc5dde
+	if (lwconf->attempts) {
bc5dde
+		tries = lwconf->attempts + 1;
bc5dde
+		if (tries < 2)
bc5dde
+			tries = 2;
bc5dde
+		debug("tries is %d.", tries);
bc5dde
+	}
bc5dde
+	if (lwconf->timeout) {
bc5dde
+		timeout = lwconf->timeout;
bc5dde
+		debug("timeout is %d.", timeout);
bc5dde
+	}
bc5dde
 
bc5dde
 	/* If user doesn't specify server use nameservers from resolv.conf. */
bc5dde
 	if (ISC_LIST_EMPTY(server_list))
bc5dde
diff -up bind-9.7.2b1/bin/dig/host.c.rh570851 bind-9.7.2b1/bin/dig/host.c
bc5dde
--- bind-9.7.2b1/bin/dig/host.c.rh570851	2010-08-10 12:57:16.032758098 +0200
bc5dde
+++ bind-9.7.2b1/bin/dig/host.c	2010-08-10 13:02:12.848559845 +0200
bc5dde
@@ -659,6 +659,7 @@ parse_args(isc_boolean_t is_batchfile, i
bc5dde
 
bc5dde
 	lookup->servfail_stops = ISC_FALSE;
bc5dde
 	lookup->comments = ISC_FALSE;
bc5dde
+	short_form = !verbose;
bc5dde
 
bc5dde
 	while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
bc5dde
 		switch (c) {
bc5dde
@@ -869,8 +870,8 @@ main(int argc, char **argv) {
bc5dde
 	result = isc_app_start();
bc5dde
 	check_result(result, "isc_app_start");
bc5dde
 	setup_libs();
bc5dde
-	parse_args(ISC_FALSE, argc, argv);
bc5dde
 	setup_system();
bc5dde
+	parse_args(ISC_FALSE, argc, argv);
bc5dde
 	result = isc_app_onrun(mctx, global_task, onrun_callback, NULL);
bc5dde
 	check_result(result, "isc_app_onrun");
bc5dde
 	isc_app_run();
bc5dde
diff -up bind-9.7.2b1/bin/dig/include/dig/dig.h.rh570851 bind-9.7.2b1/bin/dig/include/dig/dig.h
bc5dde
--- bind-9.7.2b1/bin/dig/include/dig/dig.h.rh570851	2010-08-10 13:02:32.722244088 +0200
bc5dde
+++ bind-9.7.2b1/bin/dig/include/dig/dig.h	2010-08-10 13:02:48.465158159 +0200
bc5dde
@@ -278,6 +278,7 @@ extern isc_boolean_t debugging, memdebug
bc5dde
 extern char *progname;
bc5dde
 extern int tries;
bc5dde
 extern int fatalexit;
bc5dde
+extern isc_boolean_t verbose;
bc5dde
 #ifdef WITH_IDN
bc5dde
 extern int idnoptions;
bc5dde
 #endif
bc5dde
diff -up bind-9.7.2b1/lib/lwres/include/lwres/lwres.h.rh570851 bind-9.7.2b1/lib/lwres/include/lwres/lwres.h
bc5dde
--- bind-9.7.2b1/lib/lwres/include/lwres/lwres.h.rh570851	2010-08-10 13:04:40.465780506 +0200
bc5dde
+++ bind-9.7.2b1/lib/lwres/include/lwres/lwres.h	2010-08-10 13:05:57.559867830 +0200
bc5dde
@@ -243,6 +243,8 @@ typedef struct {
bc5dde
 	lwres_uint8_t	resdebug;      /*%< non-zero if 'options debug' set */
bc5dde
 	lwres_uint8_t	ndots;	       /*%< set to n in 'options ndots:n' */
bc5dde
 	lwres_uint8_t	no_tld_query;  /*%< non-zero if 'options no_tld_query' */
bc5dde
+	lwres_int32_t	attempts;      /*%< set to n in 'options attempts:n' */
bc5dde
+	lwres_int32_t	timeout;       /*%< set to n in 'options timeout:n' */
bc5dde
 } lwres_conf_t;
bc5dde
 
bc5dde
 #define LWRES_ADDRTYPE_V4		0x00000001U	/*%< ipv4 */
bc5dde
diff -up bind-9.7.2b1/lib/lwres/lwconfig.c.rh570851 bind-9.7.2b1/lib/lwres/lwconfig.c
bc5dde
--- bind-9.7.2b1/lib/lwres/lwconfig.c.rh570851	2010-08-10 13:06:08.051778429 +0200
bc5dde
+++ bind-9.7.2b1/lib/lwres/lwconfig.c	2010-08-10 13:09:53.972555776 +0200
bc5dde
@@ -237,6 +237,8 @@ lwres_conf_init(lwres_context_t *ctx) {
bc5dde
 	confdata->resdebug = 0;
bc5dde
 	confdata->ndots = 1;
bc5dde
 	confdata->no_tld_query = 0;
bc5dde
+	confdata->attempts = 0;
bc5dde
+	confdata->timeout = 0;
bc5dde
 
bc5dde
 	for (i = 0; i < LWRES_CONFMAXNAMESERVERS; i++)
bc5dde
 		lwres_resetaddr(&confdata->nameservers[i]);
bc5dde
@@ -289,6 +291,8 @@ lwres_conf_clear(lwres_context_t *ctx) {
bc5dde
 	confdata->resdebug = 0;
bc5dde
 	confdata->ndots = 1;
bc5dde
 	confdata->no_tld_query = 0;
bc5dde
+	confdata->attempts = 0;
bc5dde
+	confdata->timeout = 0;
bc5dde
 }
bc5dde
 
bc5dde
 static lwres_result_t
bc5dde
@@ -530,6 +534,8 @@ static lwres_result_t
bc5dde
 lwres_conf_parseoption(lwres_context_t *ctx,  FILE *fp) {
bc5dde
 	int delim;
bc5dde
 	long ndots;
bc5dde
+	long attempts;
bc5dde
+	long timeout;
bc5dde
 	char *p;
bc5dde
 	char word[LWRES_CONFMAXLINELEN];
bc5dde
 	lwres_conf_t *confdata;
bc5dde
@@ -546,6 +552,8 @@ lwres_conf_parseoption(lwres_context_t *
bc5dde
 			confdata->resdebug = 1;
bc5dde
 		} else if (strcmp("no_tld_query", word) == 0) {
bc5dde
 			confdata->no_tld_query = 1;
bc5dde
+		} else if (strcmp("debug", word) == 0) {
bc5dde
+			confdata->resdebug = 1;
bc5dde
 		} else if (strncmp("ndots:", word, 6) == 0) {
bc5dde
 			ndots = strtol(word + 6, &p, 10);
bc5dde
 			if (*p != '\0') /* Bad string. */
bc5dde
@@ -553,6 +561,18 @@ lwres_conf_parseoption(lwres_context_t *
bc5dde
 			if (ndots < 0 || ndots > 0xff) /* Out of range. */
bc5dde
 				return (LWRES_R_FAILURE);
bc5dde
 			confdata->ndots = (lwres_uint8_t)ndots;
bc5dde
+		} else if (strncmp("timeout:", word, 8) == 0) {
bc5dde
+			timeout = strtol(word + 8, &p, 10);
bc5dde
+			if (*p != '\0') /* Bad string. */
bc5dde
+				return (LWRES_R_FAILURE);
bc5dde
+			confdata->timeout = (lwres_int32_t)timeout;
bc5dde
+		} else if (strncmp("attempts:", word, 9) == 0) {
bc5dde
+			attempts = strtol(word + 9, &p, 10);
bc5dde
+			if (*p != '\0') /* Bad string. */
bc5dde
+				return (LWRES_R_FAILURE);
bc5dde
+			if (attempts < 0) /* Out of range. */
bc5dde
+				return (LWRES_R_FAILURE);
bc5dde
+			confdata->attempts = (lwres_int32_t)attempts;
bc5dde
 		}
bc5dde
 
bc5dde
 		if (delim == EOF || delim == '\n')
bc5dde
@@ -716,6 +736,12 @@ lwres_conf_print(lwres_context_t *ctx, F
bc5dde
 	if (confdata->no_tld_query)
bc5dde
 		fprintf(fp, "options no_tld_query\n");
bc5dde
 
bc5dde
+	if (confdata->attempts)
bc5dde
+		fprintf(fp, "options attempts:%d\n", confdata->attempts);
bc5dde
+
bc5dde
+	if (confdata->timeout)
bc5dde
+		fprintf(fp, "options timeout:%d\n", confdata->timeout);
bc5dde
+
bc5dde
 	return (LWRES_R_SUCCESS);
bc5dde
 }
bc5dde