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 .
getaddrinfo() uses the DNS protocol to talk to your name servers, which are configured using their IP address.
DNS caching allows any DNS server or client to locally store the DNS records and re-use them in the future – eliminating the need for new DNS queries. The Domain Name System implements a time-to-live (TTL) on every DNS record. TTL specifies the number of seconds the record can be cached by a DNS client or server.
Creating a resolver DNS cache Create a resolver cache on the BIG-IP® system when you want the system to resolve DNS queries and cache responses. On the Main tab, click DNS > Caches > Cache List . The DNS Cache List screen opens. Click Create.
In general, no, the glibc resolver does not cache getaddrinfo
results.
On systems running nscd
, some names may be cached. (At least, gethostbyname
may go through cache; I'm not sure about getaddrinfo
.) 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With