to use when making queries.
+1608. [func] dig and host now accept -4/-6 to select IP transport
+ to use when making queries.
+
1607. [bug] dig, host and nslookup were still using random()
to generate query ids. [RT# 11013]
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dig.c,v 1.186 2004/03/16 05:52:13 marka Exp $ */
+/* $Id: dig.c,v 1.187 2004/04/13 01:09:36 marka Exp $ */
#include <config.h>
#include <stdlib.h>
" -c class (specify query class)\n"
" -k keyfile (specify tsig key file)\n"
" -y name:key (specify named base64 tsig key)\n"
+" -4 (use IPv4 query transport only)\n"
+" -6 (use IPv6 query transport only)\n"
" d-opt is of the form +keyword[=value], where keyword is:\n"
" +[no]vc (TCP mode)\n"
" +[no]tcp (TCP mode, alternate syntax)\n"
case 'n':
/* deprecated */
return (ISC_FALSE);
+ case '4':
+ if (have_ipv4) {
+ isc_net_disableipv6();
+ have_ipv6 = ISC_FALSE;
+ } else
+ fatal("can't find IPv4 networking");
+ return (ISC_FALSE);
+ case '6':
+ if (have_ipv6) {
+ isc_net_disableipv4();
+ have_ipv4 = ISC_FALSE;
+ } else
+ fatal("can't find IPv6 networking");
+ return (ISC_FALSE);
case 'v':
version();
exit(0);
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: dig.docbook,v 1.17 2004/03/05 04:57:30 marka Exp $ -->
+<!-- $Id: dig.docbook,v 1.18 2004/04/13 01:09:36 marka Exp $ -->
<refentry>
<arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
<arg><option>-x <replaceable class="parameter">addr</replaceable></option></arg>
<arg><option>-y <replaceable class="parameter">name:key</replaceable></option></arg>
+<arg><option>-4</option></arg>
+<arg><option>-6</option></arg>
<arg choice=opt>name</arg>
<arg choice=opt>type</arg>
<arg choice=opt>class</arg>
on a non-standard port number.
</para>
+<para>
+The <option>-4</option> option forces <command>dig</command> to only
+use IPv4 query transport. The <option>-6</option> option forces
+<command>dig</command> to only use IPv6 query transport.
+</para>
+
<para>
The <option>-t</option> option sets the query type to
<parameter>type</parameter>. It can be any valid query type which is
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: host.c,v 1.94 2004/03/05 04:57:30 marka Exp $ */
+/* $Id: host.c,v 1.95 2004/04/13 01:09:37 marka Exp $ */
#include <config.h>
#include <limits.h>
extern dig_serverlist_t server_list;
extern ISC_LIST(dig_searchlist_t) search_list;
+extern isc_boolean_t have_ipv4, have_ipv6;
extern isc_boolean_t usesearch;
extern isc_boolean_t debugging;
extern unsigned int timeout;
" -T enables TCP/IP mode\n"
" -v enables verbose output\n"
" -w specifies to wait forever for a reply\n"
-" -W specifies how long to wait for a reply\n", stderr);
+" -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);
exit(1);
}
lookup = make_empty_lookup();
- while ((c = isc_commandline_parse(argc, argv, "lvwrdt:c:aTCN:R:W:Dni"))
+ while ((c = isc_commandline_parse(argc, argv, "lvwrdt:c:aTCN:R:W:Dni46"))
!= EOF) {
switch (c) {
case 'l':
case 'D':
debugging = ISC_TRUE;
break;
+ case '4':
+ if (have_ipv4) {
+ isc_net_disableipv6();
+ have_ipv6 = ISC_FALSE;
+ } else
+ fatal("can't find IPv4 networking");
+ break;
+ case '6':
+ if (have_ipv6) {
+ isc_net_disableipv4();
+ have_ipv4 = ISC_FALSE;
+ } else
+ fatal("can't find IPv6 networking");
+ break;
}
}
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: host.docbook,v 1.5 2004/03/05 04:57:30 marka Exp $ -->
+<!-- $Id: host.docbook,v 1.6 2004/04/13 01:09:37 marka Exp $ -->
<refentry>
<arg><option>-R <replaceable class="parameter">number</replaceable></option></arg>
<arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
<arg><option>-W <replaceable class="parameter">wait</replaceable></option></arg>
+ <arg><option>-4</option></arg>
+ <arg><option>-6</option></arg>
<arg choice=req>name</arg>
<arg choice=opt>server</arg>
</cmdsynopsis>
require it, such as zone transfer (AXFR) requests.
</para>
+<para>
+The <option>-4</option> option forces <command>host</command> to only
+use IPv4 query transport. The <option>-6</option> option forces
+<command>host</command> to only use IPv6 query transport.
+</para>
+
<para>
The <option>-t</option> option is used to select the query type.
<parameter>type</parameter> can be any recognised query type: CNAME,