I am using system call getaddrinfo() to obtain IP address from DNS.
I will like to know if the cache information is stored on Linux or not?
If the cached information is stored, is it possible to clear the cache information?
I will like to know how to clear the cache information.
Thanks .
In general, no, the glibc resolver does not cache
getaddrinforesults.On systems running
nscd, some names may be cached. (At least,gethostbynamemay go through cache; I’m not sure aboutgetaddrinfo.) Restart the daemon to clear the cache.It is usually expected that the upstream (presumably recursive) DNS resolver is performing caching. In most situations, that is outside of your control.