PATCH: dig warn user when querying ANY towards recursive server (fwd)

Paul Wouters paul at
Sun Jul 22 17:19:29 UTC 2012

(I don't think this made it to the list before, mixup of email addresses)

Please consider including this patch,


---------- Forwarded message ----------
Date: Mon, 2 Jul 2012 17:45:08
From: Paul Wouters <paul at>
Cc: Paul Vixie <paul at>
To: bind-users at
Subject: PATCH: dig warn user when querying ANY towards recursive server


As recently came up, when querying a recursive caching server for ANY
will only result on cached entries being returned, and not the whole
possible set. For that you need to query the authoritative server.

I wasn't aware of this, and since I'm sure I'll forget about this again
too, I wrote a patch for dig to remind me. Please apply :)

-------------- next part --------------
diff -aur bind-9.9.1-P1-orig/bin/dig/dig.c bind-9.9.1-P1/bin/dig/dig.c
--- bind-9.9.1-P1-orig/bin/dig/dig.c	2012-06-01 11:29:52.000000000 -0400
+++ bind-9.9.1-P1/bin/dig/dig.c	2012-07-02 17:37:26.360724292 -0400
@@ -537,6 +537,11 @@
+			if ( (query->lookup->rdtype == dns_rdatatype_any) &&
+			    (msg->flags & DNS_MESSAGEFLAG_RA) != 0)
+				printf("\n\n;; WARNING: Requested ANY data from a caching recursive server!\n"
+				           "            The returned answer from cache might be incomplete.\n\n");
 			if (msg != query->lookup->sendmsg &&
 			    (msg->flags & DNS_MESSAGEFLAG_RD) != 0 &&
 			    (msg->flags & DNS_MESSAGEFLAG_RA) == 0)

More information about the bind-users mailing list