From: Otto Moerbeek Date: Tue, 4 Jun 2019 09:22:40 +0000 (+0200) Subject: stubquery: Fix handling of optional type arg. X-Git-Tag: dnsdist-1.4.0-beta1~7^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=62ec3c219273965eae887c7a7375365e5a77414e;p=pdns stubquery: Fix handling of optional type arg. --- diff --git a/pdns/stubquery.cc b/pdns/stubquery.cc index afffa27b4..1da9644a2 100644 --- a/pdns/stubquery.cc +++ b/pdns/stubquery.cc @@ -38,11 +38,13 @@ try } } - if(argc < 2) { + if(argc <= 1) { usage(); exit(EXIT_FAILURE); } + string type(argc == 2 ? "A" : argv[2]); + ::arg().set("resolver","Use this resolver for ALIAS and the internal stub resolver")="no"; reportAllTypes(); @@ -50,7 +52,7 @@ try vector ret; - int res=stubDoResolve(DNSName(argv[1]), DNSRecordContent::TypeToNumber(argv[2]), ret); + int res=stubDoResolve(DNSName(argv[1]), DNSRecordContent::TypeToNumber(type), ret); cout<<"res: "<