net/dnscache: cache all IPs per hostname

Not yet used in the dialer, but plumbed around.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-07-26 11:58:28 -07:00
committed by Brad Fitzpatrick
parent 7428ecfebd
commit e299300b48
2 changed files with 43 additions and 34 deletions

View File

@@ -370,7 +370,7 @@ func (c *Client) dialURL(ctx context.Context) (net.Conn, error) {
dialer := netns.NewDialer()
if c.DNSCache != nil {
ip, _, err := c.DNSCache.LookupIP(ctx, host)
ip, _, _, err := c.DNSCache.LookupIP(ctx, host)
if err == nil {
hostOrIP = ip.String()
}