]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
be more dig like and default to NS . when no args are given. This is checks for name...
authorMiek Gieben <miekg@NLnetLabs.nl>
Thu, 8 Dec 2005 10:47:05 +0000 (10:47 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Thu, 8 Dec 2005 10:47:05 +0000 (10:47 +0000)
drill/drill.c

index 8fcc6a6045f45929bdc26df7a1b707a4add75dca..7b6304b1d5e4bba742506580b498ff77ac89e136 100644 (file)
@@ -360,6 +360,14 @@ main(int argc, char *argv[])
                /* it all fails assume it's a name */
                name = argv[i];
        }
+       /* check if name is defined, otherwise we have nothing to do */
+       if (!name) {
+               /* act like dig and use for . NS */
+               name = ".";
+               int_type = 0;
+               type = LDNS_RR_TYPE_NS;
+       }
+       
        /* defaults if not given */
        if (int_clas == -1) {
                clas = LDNS_RR_CLASS_IN;
@@ -368,6 +376,7 @@ main(int argc, char *argv[])
                type = LDNS_RR_TYPE_A;
        }
 
+
        /* if we're asking for DNSSEC records, act as if -D with given */
        if (type == LDNS_RR_TYPE_DNSKEY ||
                        type == LDNS_RR_TYPE_RRSIG ||