From 62ec3c219273965eae887c7a7375365e5a77414e Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 4 Jun 2019 11:22:40 +0200 Subject: [PATCH] stubquery: Fix handling of optional type arg. --- pdns/stubquery.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pdns/stubquery.cc b/pdns/stubquery.cc index afffa27b43..1da9644a2d 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: "<