DNS caching using getaddrinfo

I am using the getaddrinfo () system call to get the IP address from DNS.

I would like to know if cache information is stored on Linux or not?

If the cached information is saved, is it possible to clear the cache information?

I would like to know how to clear cache information.

Thank.

+5
source share
1 answer

Generally not, the glibc resolver does not cache the results getaddrinfo.

On systems running nscd, some names may be cached. (At least it gethostbynamecan go through the cache, I'm not sure getaddrinfo.) Restart the daemon to clear the cache.

, ( ) DNS- . .

+4

All Articles