]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2169. [bug] nslookup: when reporting NXDOMAIN report the given
authorMark Andrews <marka@isc.org>
Tue, 24 Apr 2007 07:20:45 +0000 (07:20 +0000)
committerMark Andrews <marka@isc.org>
Tue, 24 Apr 2007 07:20:45 +0000 (07:20 +0000)
                        name and not the last name searched for. [RT #16763]

CHANGES
bin/dig/host.c
bin/dig/nslookup.c

diff --git a/CHANGES b/CHANGES
index 4ca0655d7f69f05053d246ce21c318d777496e7d..424c50c33287f79ba5b3ec5e086b071a91cc249b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2169.  [bug]           nslookup: when reporting NXDOMAIN report the given
+                       name and not the last name searched for. [RT #16763]
+
 2168.  [bug]           nsupdate: in non-interactive mode treat syntax errors
                        as fatal errors. [RT #16785]
 
index c9f88c597d73f463c8621e06f7749c23011fa41b..b7ccf40add342b1b3a961b06449a43955f31c884 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: host.c,v 1.112 2007/02/26 23:46:54 tbox Exp $ */
+/* $Id: host.c,v 1.113 2007/04/24 07:20:45 marka Exp $ */
 
 /*! \file */
 
@@ -426,8 +426,10 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
        if (msg->rcode != 0) {
                char namestr[DNS_NAME_FORMATSIZE];
                dns_name_format(query->lookup->name, namestr, sizeof(namestr));
-               printf("Host %s not found: %d(%s)\n", namestr,
-                      msg->rcode, rcodetext[msg->rcode]);
+               printf("Host %s not found: %d(%s)\n",
+                      (msg->rcode != dns_rcode_nxdomain) ? namestr :
+                      query->lookup->textname, msg->rcode,
+                      rcodetext[msg->rcode]);
                return (ISC_R_SUCCESS);
        }
 
index 0e303b62c7e98403fafc4941a345945897c2ab17..521985b731acf8ac6795e1e22b22feab762a0ea0 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nslookup.c,v 1.114 2006/12/07 05:52:16 marka Exp $ */
+/* $Id: nslookup.c,v 1.115 2007/04/24 07:20:45 marka Exp $ */
 
 #include <config.h>
 
@@ -410,8 +410,9 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
                char nametext[DNS_NAME_FORMATSIZE];
                dns_name_format(query->lookup->name,
                                nametext, sizeof(nametext));
-               printf("** server can't find %s: %s\n", nametext,
-                      rcodetext[msg->rcode]);
+               printf("** server can't find %s: %s\n",
+                      (msg->rcode != dns_rcode_nxdomain) ? nametext :
+                      query->lookup->textname, rcodetext[msg->rcode]);
                debug("returning with rcode == 0");
                return (ISC_R_SUCCESS);
        }