Implement DNS querying cache management API #57641
Labels
cares
Issues and PRs related to the c-ares dependency or the cares_wrap binding.
dns
Issues and PRs related to the dns subsystem.
feature request
Issues that request new features to be added to Node.js.
What is the problem this feature will solve?
Follow up to #57640 , we should create an API that allows users to specify the DNS querying cache TTL.
With the addition of this API, we should restore the default behavior to match the (sensible) defaults of c-ares (i.e. remove the qcache_max_ttl=0`).
I will contribute this in the coming days.
What is the feature you are proposing to solve the problem?
API I have in my head is to add a
ttl
option to https://nodejs.org/api/dns.html#resolveroptions and to all of the shortcuts too i.e. https://nodejs.org/api/dns.html#dnsresolvehostname-rrtype-callbackSomething like
dns.resolve('...', { ttl: 100 }, () => {});
ornew dns.Resolver({ ttl: 100 });
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: