]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
add --www feature to dnsbulktest to make it (not) add www. to everything too 5750/head
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 29 Sep 2017 06:07:53 +0000 (08:07 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 29 Sep 2017 06:07:53 +0000 (08:07 +0200)
pdns/dnsbulktest.cc

index c17713dd662520674e278d9b7a9476f439f25677..be0221d31cebcf17e2ad09cd278652c10cbb121d 100644 (file)
@@ -224,6 +224,7 @@ try
     ("type,t",  po::value<string>()->default_value("A"), "What type to query for")
     ("envoutput,e", "write report in shell environment format")
     ("version", "show the version number")
+    ("www", po::value<bool>()->default_value("true"), "duplicate all queries with an additional 'www.' in front")
   ;
 
   po::options_description alloptions;
@@ -258,6 +259,7 @@ try
     return EXIT_FAILURE;
   }
 
+  bool doWww = g_vm["www"].as<bool>();
   g_quiet = g_vm.count("quiet") > 0;
   g_envoutput = g_vm.count("envoutput") > 0;
   uint16_t qtype;
@@ -303,7 +305,8 @@ try
       continue; // this was an IP address
     }
     domains.push_back(TypedQuery(split.second, qtype));
-    domains.push_back(TypedQuery("www."+split.second, qtype));
+    if(doWww)
+      domains.push_back(TypedQuery("www."+split.second, qtype));
   }
   cerr<<"Read "<<domains.size()<<" domains!"<<endl;
   random_shuffle(domains.begin(), domains.end());