3 ms·
Why DNS lookups are so slow inside Google Cloud Platform?
I see that our machines are using 169.254.xxx.xxx:53 for DNS lookups. Out of total 4844 lookups, 2156 took <5ms.
I am using Go.
const timeout = 5 * time.Millisecond
ctx, cancel := context.WithTimeout(context.TODO(), timeout)
defer cancel()
var r net.Resolver
addrs, err := r.LookupAddr(ctx, addr)
if err != nil {
return reasons, err
}