diff options
author | Daniel Stenberg <daniel@haxx.se> | 2023-05-08 11:11:36 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2023-05-08 14:55:26 +0200 |
commit | 9ed7d56e044f5aa1b2928ccde6245d0162cf3d0a (patch) | |
tree | 4b0e9a4b4fc9e1bd309a2a79132690fc8316c6d5 /docs | |
parent | f62557276a9e2a5fb1876d87f5eee614ad7ef109 (diff) | |
download | curl-9ed7d56e044f5aa1b2928ccde6245d0162cf3d0a.tar.gz |
hostip: enforce a maximum DNS cache size independent of timeout value
To reduce the damage an application can cause if using -1 or other
ridiculous timeout values and letting the cache live long times.
The maximum number of entries in the DNS cache is now totally
arbitrarily and hard-coded set to 29999.
Closes #11084
Diffstat (limited to 'docs')
-rw-r--r-- | docs/libcurl/opts/CURLOPT_DNS_CACHE_TIMEOUT.3 | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/libcurl/opts/CURLOPT_DNS_CACHE_TIMEOUT.3 b/docs/libcurl/opts/CURLOPT_DNS_CACHE_TIMEOUT.3 index bd9207831..e841f74f6 100644 --- a/docs/libcurl/opts/CURLOPT_DNS_CACHE_TIMEOUT.3 +++ b/docs/libcurl/opts/CURLOPT_DNS_CACHE_TIMEOUT.3 @@ -37,15 +37,23 @@ memory and used for this number of seconds. Set to zero to completely disable caching, or set to -1 to make the cached entries remain forever. By default, libcurl caches this info for 60 seconds. +We recommend users not to tamper with this option unless strictly necessary. +If you do, be careful of using large values that can make the cache size grow +significantly if many different host names are used within that timeout +period. + The name resolve functions of various libc implementations do not re-read name server information unless explicitly told so (for example, by calling \fIres_init(3)\fP). This may cause libcurl to keep using the older server even if DHCP has updated the server info, and this may look like a DNS cache issue to the casual libcurl-app user. -Note that DNS entries have a "TTL" property but libcurl does not use that. This -DNS cache timeout is entirely speculative that a name will resolve to the same +DNS entries have a "TTL" property but libcurl does not use that. This DNS +cache timeout is entirely speculative that a name will resolve to the same address for a certain small amount of time into the future. + +Since version 8.1.0, libcurl prunes entries from the DNS cache if it excceeds +30,000 entries no matter which timeout value is used. .SH DEFAULT 60 .SH PROTOCOLS |