jvdias 207484
--- bind-9.3.2b2/bin/dig/host.1.no_servfail_stops	2005-10-12 22:33:43.000000000 -0400
jvdias 207484
+++ bind-9.3.2b2/bin/dig/host.1	2005-11-15 12:51:26.000000000 -0500
jvdias 207484
@@ -30,7 +30,7 @@
jvdias 207484
 host \- DNS lookup utility
jvdias 207484
 .SH "SYNOPSIS"
jvdias 207484
 .HP 5
jvdias 207484
-\fBhost\fR [\fB\-aCdlnrTwv\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-N\ \fR\fB\fIndots\fR\fR] [\fB\-R\ \fR\fB\fInumber\fR\fR] [\fB\-t\ \fR\fB\fItype\fR\fR] [\fB\-W\ \fR\fB\fIwait\fR\fR] [\fB\-4\fR] [\fB\-6\fR] {name} [server]
jvdias 207484
+\fBhost\fR [\fB\-aCdlnrTwv\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-N\ \fR\fB\fIndots\fR\fR] [\fB\-R\ \fR\fB\fInumber\fR\fR] [\fB\-t\ \fR\fB\fItype\fR\fR] [\fB\-W\ \fR\fB\fIwait\fR\fR] [\fB\-4\fR] [\fB\-6\fR] [ \fB\-s\fR ] {name} [server]
jvdias 207484
 .SH "DESCRIPTION"
jvdias 207484
 .PP
jvdias 207484
 \fBhost\fR
jvdias 207484
@@ -176,6 +176,11 @@
jvdias 207484
 option is used,
jvdias 207484
 \fBhost\fR
jvdias 207484
 will effectively wait forever for a reply. The time to wait for a response will be set to the number of seconds given by the hardware's maximum value for an integer quantity.
jvdias 207484
+.PP
jvdias 207484
+The \fB-s\fR option tells \fBhost\fR NOT to send the query to the next nameserver if any
jvdias 207484
+server responds with a SERVFAIL response, which is the reverse of normal stub resolver
jvdias 207484
+behaviour.
jvdias 207484
+.PP
jvdias 207484
 .SH "FILES"
jvdias 207484
 .PP
jvdias 207484
 \fI/etc/resolv.conf\fR
jvdias 207484
--- bind-9.3.2b2/bin/dig/nslookup.c.no_servfail_stops	2005-07-12 01:47:42.000000000 -0400
jvdias 207484
+++ bind-9.3.2b2/bin/dig/nslookup.c	2005-11-15 12:49:55.000000000 -0500
jvdias 207484
@@ -50,7 +50,8 @@
jvdias 207484
 	comments = ISC_TRUE, section_question = ISC_TRUE,
jvdias 207484
 	section_answer = ISC_TRUE, section_authority = ISC_TRUE,
jvdias 207484
 	section_additional = ISC_TRUE, recurse = ISC_TRUE,
jvdias 207484
-	aaonly = ISC_FALSE;
jvdias 207484
+        aaonly = ISC_FALSE, nofail=ISC_TRUE;
jvdias 207484
+
jvdias 207484
 static isc_boolean_t in_use = ISC_FALSE;
jvdias 207484
 static char defclass[MXRD] = "IN";
jvdias 207484
 static char deftype[MXRD] = "A";
jvdias 207484
@@ -631,6 +632,10 @@
jvdias 207484
 		usesearch = ISC_FALSE;
jvdias 207484
 	} else if (strncasecmp(opt, "sil", 3) == 0) {
jvdias 207484
 		/* deprecation_msg = ISC_FALSE; */
jvdias 207484
+	} else if (strncasecmp(opt, "fail", 3) == 0) {
jvdias 207484
+	       nofail=ISC_FALSE;
jvdias 207484
+	} else if (strncasecmp(opt, "nofail", 3) == 0) {
jvdias 207484
+	       nofail=ISC_TRUE;
jvdias 207484
 	} else {
jvdias 207484
 		printf("*** Invalid option: %s\n", opt);	
jvdias 207484
 	}
jvdias 207484
@@ -689,6 +694,8 @@
jvdias 207484
 	lookup->section_authority = section_authority;
jvdias 207484
 	lookup->section_additional = section_additional;
jvdias 207484
 	lookup->new_search = ISC_TRUE;
jvdias 207484
+	if ( nofail )
jvdias 207484
+	    lookup->servfail_stops = ISC_FALSE;
jvdias 207484
 	ISC_LIST_INIT(lookup->q);
jvdias 207484
 	ISC_LINK_INIT(lookup, link);
jvdias 207484
 	ISC_LIST_APPEND(lookup_list, lookup, link);
jvdias 207484
--- bind-9.3.2b2/bin/dig/nslookup.1.no_servfail_stops	2005-10-12 22:33:43.000000000 -0400
jvdias 207484
+++ bind-9.3.2b2/bin/dig/nslookup.1	2005-11-15 12:49:55.000000000 -0500
jvdias 207484
@@ -166,6 +166,12 @@
jvdias 207484
 Always use a virtual circuit when sending requests to the server.
jvdias 207484
 .sp
jvdias 207484
 (Default = novc)
jvdias 207484
+.TP
jvdias 207484
+\fB[no]fail\R
jvdias 207484
+Try the next nameserver if a nameserver responds with SERVFAIL or
jvdias 207484
+a referral (nofail) or terminate query (fail) on such a response.
jvdias 207484
+
jvdias 207484
+(Default = nofail)
jvdias 207484
 .RE
jvdias 207484
 .IP
jvdias 207484
 .SH "FILES"
jvdias 207484
--- bind-9.3.2b2/bin/dig/host.c.no_servfail_stops	2005-07-03 23:29:45.000000000 -0400
jvdias 207484
+++ bind-9.3.2b2/bin/dig/host.c	2005-11-15 12:49:55.000000000 -0500
jvdias 207484
@@ -128,7 +128,8 @@
jvdias 207484
 "       -w specifies to wait forever for a reply\n"
jvdias 207484
 "       -W specifies how long to wait for a reply\n"
jvdias 207484
 "       -4 use IPv4 query transport only\n"
jvdias 207484
-"       -6 use IPv6 query transport only\n", stderr);
jvdias 207484
+"       -6 use IPv6 query transport only\n"
jvdias 207484
+"       -s a SERVFAIL response should stop query\n", stderr);
jvdias 207484
 	exit(1);
jvdias 207484
 }
jvdias 207484
 
jvdias 207484
@@ -538,7 +539,10 @@
jvdias 207484
 
jvdias 207484
 	lookup = make_empty_lookup();
jvdias 207484
 
jvdias 207484
-	while ((c = isc_commandline_parse(argc, argv, "lvwrdt:c:aTCN:R:W:Dni46"))
jvdias 207484
+	lookup->servfail_stops = ISC_FALSE;
jvdias 207484
+	lookup->comments = ISC_FALSE;
jvdias 207484
+
jvdias 207484
+	while ((c = isc_commandline_parse(argc, argv, "lvwrdt:c:aTCN:R:W:Dni46s"))
jvdias 207484
 	       != EOF) {
jvdias 207484
 		switch (c) {
jvdias 207484
 		case 'l':
jvdias 207484
@@ -676,6 +680,9 @@
jvdias 207484
 			} else
jvdias 207484
 				fatal("can't find IPv6 networking");
jvdias 207484
 			break;
jvdias 207484
+		case 's':
jvdias 207484
+		        lookup->servfail_stops = ISC_TRUE;
jvdias 207484
+			break;
jvdias 207484
 		}
jvdias 207484
 	}
jvdias 207484