" +[no]ednsnegotiation (Set EDNS version negotiation)\n"
" +ednsopt=###[:value] (Send specified EDNS option)\n"
" +noednsopt (Clear list of +ednsopt options)\n"
+" +[no]expandaaaa (Expand AAAA records)\n"
" +[no]expire (Request time to expire)\n"
" +[no]fail (Don't try next server on SERVFAIL)\n"
" +[no]header-only (Send query without a question section)\n"
styleflags |= DNS_STYLEFLAG_NO_CLASS;
if (query->lookup->nocrypto)
styleflags |= DNS_STYLEFLAG_NOCRYPTO;
+ if (query->lookup->expandaaaa)
+ styleflags |= DNS_STYLEFLAG_EXPANDAAAA;
if (query->lookup->multiline) {
styleflags |= DNS_STYLEFLAG_OMIT_OWNER;
styleflags |= DNS_STYLEFLAG_OMIT_CLASS;
}
break;
case 'x':
- FULLCHECK("expire");
- lookup->expire = state;
+ switch (cmd[2]) {
+ case 'p':
+ switch(cmd[3]) {
+ case 'a':
+ FULLCHECK("expandaaaa");
+ lookup->expandaaaa = state;
+ break;
+ case 'i':
+ FULLCHECK("expire");
+ lookup->expire = state;
+ break;
+ default:
+ goto invalid_option;
+ }
+ break;
+ default:
+ goto invalid_option;
+ }
break;
default:
goto invalid_option;
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>+[no]expandaaaa</option></term>
+ <listitem>
+ <para>
+ When printing AAAA record print all zero nibbles rather
+ than the default RFC 5952 preferred presentation format.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>+[no]fail</option></term>
<listitem>
looknew->nocrypto = false;
looknew->ttlunits = false;
looknew->ttlunits = false;
+ looknew->expandaaaa = false;
looknew->qr = false;
#ifdef HAVE_LIBIDN2
looknew->idnin = isatty(1)?(getenv("IDN_DISABLE") == NULL):false;
looknew->use_usec = lookold->use_usec;
looknew->nocrypto = lookold->nocrypto;
looknew->ttlunits = lookold->ttlunits;
+ looknew->expandaaaa = lookold->expandaaaa;
looknew->qr = lookold->qr;
looknew->idnin = lookold->idnin;
looknew->idnout = lookold->idnout;
ttlunits,
idnin,
idnout,
+ expandaaaa,
qr;
char textname[MXNAME]; /*% Name we're going to be looking up */
char cmdline[MXNAME];
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 1 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
+
+ n=$((n+1))
+ echo_i "check that dig +expandaaaa works ($n)"
+ ret=0
+ dig_with_opts @10.53.0.3 +expandaaaa AAAA ns2.example > dig.out.test$n 2>&1 || ret=1
+ grep "ns2.example.*fd92:7065:0b8e:ffff:0000:0000:0000:0002" dig.out.test$n > /dev/null || ret=1
+ if [ $ret -ne 0 ]; then echo_i "failed"; fi
+ status=$((status+ret))
+
+ n=$((n+1))
+ echo_i "check that dig +noexpandaaaa works ($n)"
+ ret=0
+ dig_with_opts @10.53.0.3 +noexpandaaaa AAAA ns2.example > dig.out.test$n 2>&1 || ret=1
+ grep "ns2.example.*fd92:7065:b8e:ffff::2" dig.out.test$n > /dev/null || ret=1
+ if [ $ret -ne 0 ]; then echo_i "failed"; fi
+ status=$((status+ret))
+
+ n=$((n+1))
+ echo_i "check that dig default for +[no]expandaaa (+noexpandaaaa) works ($n)"
+ ret=0
+ dig_with_opts @10.53.0.3 AAAA ns2.example > dig.out.test$n 2>&1 || ret=1
+ grep "ns2.example.*fd92:7065:b8e:ffff::2" dig.out.test$n > /dev/null || ret=1
+ if [ $ret -ne 0 ]; then echo_i "failed"; fi
+ status=$((status+ret))
else
echo_i "$DIG is needed, so skipping these dig tests"
fi
/*% Output textual RR type and RDATA in RFC 3597 unknown format */
#define DNS_STYLEFLAG_UNKNOWNFORMAT 0x00000010ULL
+/*% Print AAAA record fully expanded */
+#define DNS_STYLEFLAG_EXPANDAAAA 0x00000020ULL
+
#define DNS_RDATA_DOWNCASE DNS_NAME_DOWNCASE
#define DNS_RDATA_CHECKNAMES DNS_NAME_CHECKNAMES
#define DNS_RDATA_CHECKNAMESFAIL DNS_NAME_CHECKNAMESFAIL
totext_in_aaaa(ARGS_TOTEXT) {
isc_region_t region;
- UNUSED(tctx);
-
REQUIRE(rdata->type == dns_rdatatype_aaaa);
REQUIRE(rdata->rdclass == dns_rdataclass_in);
REQUIRE(rdata->length == 16);
+ if ((tctx->flags & DNS_STYLEFLAG_EXPANDAAAA) != 0) {
+ char buf[5*8];
+ const char *sep = "";
+ int i, n;
+ unsigned int len = 0;
+
+ for (i = 0; i < 16; i += 2) {
+ INSIST(len < sizeof(buf));
+ n = snprintf(buf + len, sizeof(buf) - len,
+ "%s%02x%02x", sep,
+ rdata->data[i], rdata->data[i + 1]);
+ if (n < 0) {
+ return (ISC_R_FAILURE);
+ }
+ len += n;
+ sep = ":";
+ }
+ return (str_totext(buf, target));
+ }
dns_rdata_toregion(rdata, ®ion);
return (inet_totext(AF_INET6, ®ion, target));
}