In the "net/http" package I can cache the DNS lookups by:
client := &http.Client{
Transport: &http.Transport{
Dial: (&nett.Dialer{
Resolver: &nett.CacheResolver{TTL: 5 * time.Minute},
IPFilter: nett.DualStack,
}).Dial,
},
}
then use client to retrieve websites. How do I cache the DNS lookups for the net package? for instance, a reverse DNS request:
net.LookupAddr(ip)
Since this does not use a variable I am confused as to how to get it setup and how to even know if I am using a cached instance.