diff --git a/dns/resolver.go b/dns/resolver.go index e1fc90a5..abc686f4 100644 --- a/dns/resolver.go +++ b/dns/resolver.go @@ -82,12 +82,16 @@ func (r *Resolver) ResolveAllIP(host string) (ips []netip.Addr, err error) { ips, err = r.resolveIP(host, D.TypeA) - ipv6s, open := <-ch - if !open && err != nil { - return nil, resolver.ErrIPNotFound + select { + case ipv6s, open := <-ch: + if !open && err != nil { + return nil, resolver.ErrIPNotFound + } + ips = append(ips, ipv6s...) + case <-time.After(3 * time.Millisecond): + // wait ipv6 3ms } - ips = append(ips, ipv6s...) return ips, nil }