Fix: dns not cache RcodeServerFailure
This commit is contained in:
parent
d19c9c1bc5
commit
717482065c
1 changed files with 7 additions and 1 deletions
|
@ -168,7 +168,13 @@ func (r *Resolver) batchExchange(clients []dnsClient, m *D.Msg) (msg *D.Msg, err
|
||||||
for _, client := range clients {
|
for _, client := range clients {
|
||||||
r := client
|
r := client
|
||||||
fast.Go(func() (interface{}, error) {
|
fast.Go(func() (interface{}, error) {
|
||||||
return r.ExchangeContext(ctx, m)
|
m, err := r.ExchangeContext(ctx, m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else if m.Rcode == D.RcodeServerFailure {
|
||||||
|
return nil, errors.New("server failure")
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue