From bd5d5905273f790d9d16e13a5413b5f7b5274a2d Mon Sep 17 00:00:00 2001 From: Esonhugh Date: Thu, 21 Mar 2024 14:16:52 +0800 Subject: [PATCH] update: all command to use DumpWildCard feature. --- cmd/all/all.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/all/all.go b/cmd/all/all.go index af23219..db92cee 100644 --- a/cmd/all/all.go +++ b/cmd/all/all.go @@ -30,8 +30,16 @@ var AllCmd = &cobra.Command{ records, err := scanner.DumpAXFR(dns.Fqdn(command.Opts.Zone), "ns.dns."+command.Opts.Zone+":53") if err == nil { printResult(records) + return } log.Errorf("Transfer failed: %v", err) + records = scanner.DumpWildCard(command.Opts.Zone) + if records != nil && len(records) > 0 { + printResult(records) + return + } + log.Errorf("WildCard dns dump failed: %v", err) + ipNets, err := pkg.ParseStringToIPNet(command.Opts.Cidr) if err != nil { log.Warnf("ParseStringToIPNet failed: %v", err)