hotfix(healthcheck/dns): use dns address tring with port
This commit is contained in:
@@ -44,12 +44,12 @@ func concatAddrPorts(addrs [][]netip.AddrPort) []netip.AddrPort {
|
|||||||
var ErrLookupNoIPs = errors.New("no IPs found from DNS lookup")
|
var ErrLookupNoIPs = errors.New("no IPs found from DNS lookup")
|
||||||
|
|
||||||
func (c *Client) Check(ctx context.Context) error {
|
func (c *Client) Check(ctx context.Context) error {
|
||||||
dnsAddr := c.serverAddrs[c.dnsIPIndex].Addr()
|
dnsAddr := c.serverAddrs[c.dnsIPIndex].String()
|
||||||
resolver := &net.Resolver{
|
resolver := &net.Resolver{
|
||||||
PreferGo: true,
|
PreferGo: true,
|
||||||
Dial: func(ctx context.Context, _, _ string) (net.Conn, error) {
|
Dial: func(ctx context.Context, _, _ string) (net.Conn, error) {
|
||||||
dialer := net.Dialer{}
|
dialer := net.Dialer{}
|
||||||
return dialer.DialContext(ctx, "udp", dnsAddr.String())
|
return dialer.DialContext(ctx, "udp", dnsAddr)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
ips, err := resolver.LookupIP(ctx, "ip", "github.com")
|
ips, err := resolver.LookupIP(ctx, "ip", "github.com")
|
||||||
|
|||||||
Reference in New Issue
Block a user