I'm using DNSPython library to get DNS resolution time in my script. I've a query on the caching part, that whether this library uses Cache on its own. My requirement is to check how much it takes to resolve DNS from a endpoint.
Here's the part of script I'm using to get resolution time now,
resolver = dns.resolver.Resolver()
resolver.timeout = 1
resolver.lifetime = 1
return float("{0:.3f}".format(dns.resolver.query(url).response.time*1000))
If DNSPython uses caching, suggest me a way to flush it. Also suggest me some other idea if available, to get DNS resolution time without caching.