Skip to content

Commit da48077

Browse files
dns: restore dns query cache ttl
Fixes: #57636 When c-ares was [updated](c5174f5e60) the default caching behavior changed. > As of c-ares 1.31.0, the query cache is enabled by default with a TTL of 1hr. To disable the query cache, specify this option with a TTL of 0. The query cache is based on the returned TTL in the DNS message. This PR restores the caching behavior by setting `qcache_max_ttl` to `0`. This change in c-ares is reasonable; thus, as a follow up to this _fix_, we should implement a cache management API for DNS queries and then re-enable the new default cache value.
1 parent 4868ca4 commit da48077

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cares_wrap.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ void ChannelWrap::Setup() {
778778
options.sock_state_cb_data = this;
779779
options.timeout = timeout_;
780780
options.tries = tries_;
781+
options.qcache_max_ttl = 0;
781782

782783
int r;
783784
if (!library_inited_) {

0 commit comments

Comments
 (0)