mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-22 18:19:42 +00:00
Add support for EDNS ZONEVERSION to dig
This add the +[no]zoneversion option to dig which adds the EDNS ZONEVERSION option to requests.
This commit is contained in:
parent
ec3cbc5468
commit
2356b75e8c
@ -328,6 +328,7 @@ help(void) {
|
|||||||
" +[no]yaml (Present the results as "
|
" +[no]yaml (Present the results as "
|
||||||
"YAML)\n"
|
"YAML)\n"
|
||||||
" +[no]zflag (Set Z flag in query)\n"
|
" +[no]zflag (Set Z flag in query)\n"
|
||||||
|
" +[no]zoneversion (Request zone version)\n"
|
||||||
" global d-opts and servers (before host name) affect "
|
" global d-opts and servers (before host name) affect "
|
||||||
"all "
|
"all "
|
||||||
"queries.\n"
|
"queries.\n"
|
||||||
@ -2574,9 +2575,22 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
|||||||
lookup->rrcomments = -1;
|
lookup->rrcomments = -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'z': /* zflag */
|
case 'z':
|
||||||
FULLCHECK("zflag");
|
switch (cmd[1]) {
|
||||||
lookup->zflag = state;
|
case 'f': /* zflag */
|
||||||
|
FULLCHECK("zflag");
|
||||||
|
lookup->zflag = state;
|
||||||
|
break;
|
||||||
|
case 'o': /* zoneversion */
|
||||||
|
FULLCHECK("zoneversion");
|
||||||
|
if (state && lookup->edns == -1) {
|
||||||
|
lookup->edns = DEFAULT_EDNS_VERSION;
|
||||||
|
}
|
||||||
|
lookup->zoneversion = state;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
goto invalid_option;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
invalid_option:
|
invalid_option:
|
||||||
|
@ -757,6 +757,10 @@ abbreviation is unambiguous; for example, :option:`+cd` is equivalent to
|
|||||||
This option sets [or does not set] the last unassigned DNS header flag in a DNS query.
|
This option sets [or does not set] the last unassigned DNS header flag in a DNS query.
|
||||||
This flag is off by default.
|
This flag is off by default.
|
||||||
|
|
||||||
|
.. option:: +zoneversion, +nozoneversion
|
||||||
|
|
||||||
|
When enabled, this option includes an EDNS Zone Version request when sending a query.
|
||||||
|
|
||||||
Multiple Queries
|
Multiple Queries
|
||||||
~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -705,6 +705,7 @@ clone_lookup(dig_lookup_t *lookold, bool servers) {
|
|||||||
looknew->opcode = lookold->opcode;
|
looknew->opcode = lookold->opcode;
|
||||||
looknew->expire = lookold->expire;
|
looknew->expire = lookold->expire;
|
||||||
looknew->nsid = lookold->nsid;
|
looknew->nsid = lookold->nsid;
|
||||||
|
looknew->zoneversion = lookold->zoneversion;
|
||||||
looknew->tcp_keepalive = lookold->tcp_keepalive;
|
looknew->tcp_keepalive = lookold->tcp_keepalive;
|
||||||
looknew->header_only = lookold->header_only;
|
looknew->header_only = lookold->header_only;
|
||||||
looknew->https_mode = lookold->https_mode;
|
looknew->https_mode = lookold->https_mode;
|
||||||
@ -2591,6 +2592,14 @@ setup_lookup(dig_lookup_t *lookup) {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lookup->zoneversion) {
|
||||||
|
INSIST(i < MAXOPTS);
|
||||||
|
opts[i].code = DNS_OPT_ZONEVERSION;
|
||||||
|
opts[i].length = 0;
|
||||||
|
opts[i].value = NULL;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
if (lookup->ednsoptscnt != 0) {
|
if (lookup->ednsoptscnt != 0) {
|
||||||
INSIST(i + lookup->ednsoptscnt <= MAXOPTS);
|
INSIST(i + lookup->ednsoptscnt <= MAXOPTS);
|
||||||
memmove(&opts[i], lookup->ednsopts,
|
memmove(&opts[i], lookup->ednsopts,
|
||||||
|
@ -121,7 +121,7 @@ struct dig_lookup {
|
|||||||
tcp_mode, tcp_mode_set, tls_mode, /*% connect using TLS */
|
tcp_mode, tcp_mode_set, tls_mode, /*% connect using TLS */
|
||||||
trace, /*% dig +trace */
|
trace, /*% dig +trace */
|
||||||
trace_root, /*% initial query for either +trace or +nssearch */
|
trace_root, /*% initial query for either +trace or +nssearch */
|
||||||
ttlunits, use_usec, waiting_connect, zflag;
|
ttlunits, use_usec, waiting_connect, zflag, zoneversion;
|
||||||
char textname[MXNAME]; /*% Name we're going to be looking up */
|
char textname[MXNAME]; /*% Name we're going to be looking up */
|
||||||
char cmdline[MXNAME];
|
char cmdline[MXNAME];
|
||||||
dns_rdatatype_t rdtype;
|
dns_rdatatype_t rdtype;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user