Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc4f4d32ce4b1a90e7e68ed631842990 > files > 17

bind-9.3.6-25.P1.el5_11.9.src.rpm

diff -up bind-9.3.6-P1/bin/dig/host.1.no_servfail_stops bind-9.3.6-P1/bin/dig/host.1
--- bind-9.3.6-P1/bin/dig/host.1.no_servfail_stops	2008-04-29 03:21:29.000000000 +0200
+++ bind-9.3.6-P1/bin/dig/host.1	2009-02-23 14:56:27.000000000 +0100
@@ -33,7 +33,7 @@
 host \- DNS lookup utility
 .SH "SYNOPSIS"
 .HP 5
-\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]
+\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]
 .SH "DESCRIPTION"
 .PP
 \fBhost\fR
@@ -179,6 +179,11 @@ is less than one, the wait interval is s
 option is used,
 \fBhost\fR
 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.
+.PP
+The \fB-s\fR option tells \fBhost\fR NOT to send the query to the next nameserver if any
+server responds with a SERVFAIL response, which is the reverse of normal stub resolver
+behaviour.
+.PP
 .SH "FILES"
 .PP
 \fI/etc/resolv.conf\fR
diff -up bind-9.3.6-P1/bin/dig/host.c.no_servfail_stops bind-9.3.6-P1/bin/dig/host.c
--- bind-9.3.6-P1/bin/dig/host.c.no_servfail_stops	2007-08-28 09:19:07.000000000 +0200
+++ bind-9.3.6-P1/bin/dig/host.c	2009-02-23 14:56:27.000000000 +0100
@@ -130,7 +130,8 @@ show_usage(void) {
 "       -w specifies to wait forever for a reply\n"
 "       -W specifies how long to wait for a reply\n"
 "       -4 use IPv4 query transport only\n"
-"       -6 use IPv6 query transport only\n", stderr);
+"       -6 use IPv6 query transport only\n"
+"       -s a SERVFAIL response should stop query\n", stderr);
 	exit(1);
 }
 
@@ -574,7 +575,10 @@ parse_args(isc_boolean_t is_batchfile, i
 
 	lookup = make_empty_lookup();
 
-	while ((c = isc_commandline_parse(argc, argv, "lvwrdt:c:aTCN:R:W:Dni46"))
+	lookup->servfail_stops = ISC_FALSE;
+	lookup->comments = ISC_FALSE;
+
+	while ((c = isc_commandline_parse(argc, argv, "lvwrdt:c:aTCN:R:W:Dni46s"))
 	       != EOF) {
 		switch (c) {
 		case 'l':
@@ -712,6 +716,9 @@ parse_args(isc_boolean_t is_batchfile, i
 			} else
 				fatal("can't find IPv6 networking");
 			break;
+		case 's':
+		        lookup->servfail_stops = ISC_TRUE;
+			break;
 		}
 	}
 
diff -up bind-9.3.6-P1/bin/dig/nslookup.1.no_servfail_stops bind-9.3.6-P1/bin/dig/nslookup.1
--- bind-9.3.6-P1/bin/dig/nslookup.1.no_servfail_stops	2007-05-16 08:10:54.000000000 +0200
+++ bind-9.3.6-P1/bin/dig/nslookup.1	2009-02-23 14:57:56.000000000 +0100
@@ -225,6 +225,12 @@ Change the initial timeout interval for 
 Always use a virtual circuit when sending requests to the server.
 .sp
 (Default = novc)
+.TP
+\fB[no]fail\R
+Try the next nameserver if a nameserver responds with SERVFAIL or
+a referral (nofail) or terminate query (fail) on such a response.
+
+(Default = nofail)
 .RE
 .RE
 .IP "" 4
diff -up bind-9.3.6-P1/bin/dig/nslookup.c.no_servfail_stops bind-9.3.6-P1/bin/dig/nslookup.c
--- bind-9.3.6-P1/bin/dig/nslookup.c.no_servfail_stops	2007-08-28 09:19:07.000000000 +0200
+++ bind-9.3.6-P1/bin/dig/nslookup.c	2009-02-23 14:56:27.000000000 +0100
@@ -50,7 +50,8 @@ static isc_boolean_t short_form = ISC_TR
 	comments = ISC_TRUE, section_question = ISC_TRUE,
 	section_answer = ISC_TRUE, section_authority = ISC_TRUE,
 	section_additional = ISC_TRUE, recurse = ISC_TRUE,
-	aaonly = ISC_FALSE;
+        aaonly = ISC_FALSE, nofail=ISC_TRUE;
+
 static isc_boolean_t in_use = ISC_FALSE;
 static char defclass[MXRD] = "IN";
 static char deftype[MXRD] = "A";
@@ -632,6 +633,10 @@ setoption(char *opt) {
 		usesearch = ISC_FALSE;
 	} else if (strncasecmp(opt, "sil", 3) == 0) {
 		/* deprecation_msg = ISC_FALSE; */
+	} else if (strncasecmp(opt, "fail", 3) == 0) {
+	       nofail=ISC_FALSE;
+	} else if (strncasecmp(opt, "nofail", 3) == 0) {
+	       nofail=ISC_TRUE;
 	} else {
 		printf("*** Invalid option: %s\n", opt);	
 	}
@@ -690,6 +695,8 @@ addlookup(char *opt) {
 	lookup->section_authority = section_authority;
 	lookup->section_additional = section_additional;
 	lookup->new_search = ISC_TRUE;
+	if ( nofail )
+	    lookup->servfail_stops = ISC_FALSE;
 	ISC_LIST_INIT(lookup->q);
 	ISC_LINK_INIT(lookup, link);
 	ISC_LIST_APPEND(lookup_list, lookup, link);