Skip to content

Commit

Permalink
Merge pull request #32 from projectdiscovery/bugfix-non-success-code
Browse files Browse the repository at this point in the history
[Bug] Return non-success error codes information
  • Loading branch information
Mzack9999 committed Aug 4, 2021
2 parents a93f48d + a08e225 commit e02a826
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions client.go
Expand Up @@ -182,17 +182,20 @@ func (c *Client) QueryMultiple(host string, requestTypes []uint16) (*DNSData, er
}

err = dnsdata.ParseFromMsg(resp)
if !dnsdata.contains() {
continue
}

// populate anyway basic info
dnsdata.Host = host
dnsdata.Raw += resp.String()
dnsdata.StatusCode = dns.RcodeToString[resp.Rcode]
dnsdata.StatusCodeRaw = resp.Rcode
dnsdata.Resolver = append(dnsdata.Resolver, resolver)
dnsdata.Timestamp = time.Now()
dnsdata.Raw += resp.String()
dnsdata.Resolver = append(dnsdata.Resolver, resolver)

if err != nil || !dnsdata.contains() {
continue
}
dnsdata.dedupe()

// stop on success
if resp.Rcode == dns.RcodeSuccess {
break
Expand Down

0 comments on commit e02a826

Please sign in to comment.