]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
turn off best effort processing in host and add the ability to specify the port
authorMark Andrews <marka@isc.org>
Tue, 3 Mar 2020 02:46:32 +0000 (13:46 +1100)
committerMark Andrews <marka@isc.org>
Fri, 13 Mar 2020 00:47:10 +0000 (11:47 +1100)
(cherry picked from commit 4a7b9dba61ca522f07f0ad52bc17249b6c8b5d03)

bin/dig/host.c
bin/dig/host.docbook

index 03d5b45afeb2d1869fb682f415d037e4525669fa..c94c2de0126b08da2f697c5d7bb282241f58be8c 100644 (file)
@@ -108,7 +108,7 @@ static void
 show_usage(void) {
        fputs("Usage: host [-aCdilrTvVw] [-c class] [-N ndots] [-t type] [-W "
              "time]\n"
-             "            [-R number] [-m flag] hostname [server]\n"
+             "            [-R number] [-m flag] [-p port] hostname [server]\n"
              "       -a is equivalent to -v -t ANY\n"
              "       -A is like -a but omits RRSIG, NSEC, NSEC3\n"
              "       -c specifies query class for non-IN data\n"
@@ -118,6 +118,7 @@ show_usage(void) {
              "       -m set memory debugging flag (trace|record|usage)\n"
              "       -N changes the number of dots allowed before root lookup "
              "is done\n"
+             "       -p specifies the port on the server to query\n"
              "       -r disables recursive processing\n"
              "       -R specifies number of retries for UDP packets\n"
              "       -s a SERVFAIL response should stop query\n"
@@ -575,7 +576,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
        return (result);
 }
 
-static const char *optstring = "46aAc:dilnm:rst:vVwCDN:R:TUW:";
+static const char *optstring = "46aAc:dilnm:p:rst:vVwCDN:R:TUW:";
 
 /*% version */
 static void
@@ -639,6 +640,8 @@ pre_parse_args(int argc, char **argv) {
                        break;
                case 'N':
                        break;
+               case 'p':
+                       break;
                case 'r':
                        break;
                case 'R':
@@ -686,6 +689,7 @@ parse_args(bool is_batchfile, int argc, char **argv) {
        lookup = make_empty_lookup();
 
        lookup->servfail_stops = false;
+       lookup->besteffort = false;
        lookup->comments = false;
        short_form = !verbose;
 
@@ -841,6 +845,9 @@ parse_args(bool is_batchfile, int argc, char **argv) {
                case 's':
                        lookup->servfail_stops = true;
                        break;
+               case 'p':
+                       port = atoi(isc_commandline_argument);
+                       break;
                }
        }
 
index beffd802f5ca52eb9f45b7f814694f375be5ba1f..8fb795d3461ab2462be4750ae9d0f2d3aeadd676 100644 (file)
@@ -59,6 +59,7 @@
       <arg choice="opt" rep="norepeat"><option>-aACdlnrsTUwv</option></arg>
       <arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">class</replaceable></option></arg>
       <arg choice="opt" rep="norepeat"><option>-N <replaceable class="parameter">ndots</replaceable></option></arg>
+      <arg choice="opt" rep="norepeat"><option>-p <replaceable class="port">port</replaceable></option></arg>
       <arg choice="opt" rep="norepeat"><option>-R <replaceable class="parameter">number</replaceable></option></arg>
       <arg choice="opt" rep="norepeat"><option>-t <replaceable class="parameter">type</replaceable></option></arg>
       <arg choice="opt" rep="norepeat"><option>-W <replaceable class="parameter">wait</replaceable></option></arg>
        </listitem>
       </varlistentry>
 
+      <varlistentry>
+       <term>-p <replaceable class="parameter">port</replaceable></term>
+       <listitem>
+         <para>
+           Specify the port on the server to query.  The default is 53.
+         </para>
+       </listitem>
+      </varlistentry>
+
       <varlistentry>
        <term>-r</term>
        <listitem>