Skip to content

Commit

Permalink
fix(dns): avoid early return when dns query refused (#2878)
Browse files Browse the repository at this point in the history
* avoid early return when dns query refused

* address reviews
  • Loading branch information
dop-bot authored Jan 2, 2024
1 parent 44bb830 commit 60f7a03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ func (s *DNS) LookupIP(domain string, option dns.IPOption) ([]net.IP, error) {
newError("failed to lookup ip for domain ", domain, " at server ", client.Name()).Base(err).WriteToLog()
errs = append(errs, err)
}
if err != context.Canceled && err != context.DeadlineExceeded && err != errExpectedIPNonMatch && err != dns.ErrEmptyResponse {
// 5 for RcodeRefused in miekg/dns, hardcode to reduce binary size
if err != context.Canceled && err != context.DeadlineExceeded && err != errExpectedIPNonMatch && err != dns.ErrEmptyResponse && dns.RCodeFromError(err) != 5 {
return nil, err
}
}
Expand Down

0 comments on commit 60f7a03

Please sign in to comment.