fix: dns resolver
This commit is contained in:
parent
6a97ab9ecb
commit
7c34964f87
1 changed files with 1 additions and 8 deletions
|
@ -69,10 +69,6 @@ func LookupIPv4WithResolver(ctx context.Context, host string, r Resolver) ([]net
|
||||||
return r.LookupIPv4(ctx, host)
|
return r.LookupIPv4(ctx, host)
|
||||||
}
|
}
|
||||||
|
|
||||||
if DefaultResolver != nil {
|
|
||||||
return DefaultResolver.LookupIPv4(ctx, host)
|
|
||||||
}
|
|
||||||
|
|
||||||
ipAddrs, err := net.DefaultResolver.LookupNetIP(ctx, "ip4", host)
|
ipAddrs, err := net.DefaultResolver.LookupNetIP(ctx, "ip4", host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -126,9 +122,6 @@ func LookupIPv6WithResolver(ctx context.Context, host string, r Resolver) ([]net
|
||||||
if r != nil {
|
if r != nil {
|
||||||
return r.LookupIPv6(ctx, host)
|
return r.LookupIPv6(ctx, host)
|
||||||
}
|
}
|
||||||
if DefaultResolver != nil {
|
|
||||||
return DefaultResolver.LookupIPv6(ctx, host)
|
|
||||||
}
|
|
||||||
|
|
||||||
ipAddrs, err := net.DefaultResolver.LookupNetIP(ctx, "ip6", host)
|
ipAddrs, err := net.DefaultResolver.LookupNetIP(ctx, "ip6", host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -172,7 +165,7 @@ func LookupIPWithResolver(ctx context.Context, host string, r Resolver) ([]netip
|
||||||
}
|
}
|
||||||
return r.LookupIP(ctx, host)
|
return r.LookupIP(ctx, host)
|
||||||
} else if DisableIPv6 {
|
} else if DisableIPv6 {
|
||||||
return LookupIPv4(ctx, host)
|
return LookupIPv4WithResolver(ctx, host, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ip, err := netip.ParseAddr(host); err == nil {
|
if ip, err := netip.ParseAddr(host); err == nil {
|
||||||
|
|
Loading…
Reference in a new issue