diff --git a/pkg/mutli/subnet.go b/pkg/mutli/subnet.go index da52b8f..3e3cc0a 100644 --- a/pkg/mutli/subnet.go +++ b/pkg/mutli/subnet.go @@ -45,6 +45,9 @@ func (s *SubnetScanner) ScanSubnet(subnet *net.IPNet) <-chan []define.Record { func (s *SubnetScanner) scan(subnet *net.IPNet, to chan []define.Record) { s.wg.Add(1) - to <- scanner.ScanSubnet(subnet) + // to <- scanner.ScanSubnet(subnet) + for _, ip := range pkg.ParseIPNetToIPs(subnet) { + to <- scanner.ScanSingleIP(ip) + } s.wg.Done() } diff --git a/pkg/scanner/scanner.go b/pkg/scanner/scanner.go index e998344..79ab82b 100644 --- a/pkg/scanner/scanner.go +++ b/pkg/scanner/scanner.go @@ -10,6 +10,18 @@ import ( log "github.com/sirupsen/logrus" ) +func ScanSingleIP(subnet net.IP) (records []define.Record) { + ptr := pkg.PTRRecord(subnet) + if len(ptr) > 0 { + for _, domain := range ptr { + log.Infof("PTRrecord %v --> %v", subnet, domain) + r := define.Record{Ip: subnet, SvcDomain: domain} + records = append(records, r) + } + } + return +} + func ScanSubnet(subnet *net.IPNet) (records []define.Record) { for _, ip := range pkg.ParseIPNetToIPs(subnet) { ptr := pkg.PTRRecord(ip)