Skip to content

Implement DNS querying cache management API #57641

Open
@Ethan-Arrowood

Description

@Ethan-Arrowood

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-callback

Something like dns.resolve('...', { ttl: 100 }, () => {}); or new dns.Resolver({ ttl: 100 });

What alternatives have you considered?

No response

Metadata

Metadata

Labels

caresIssues and PRs related to the c-ares dependency or the cares_wrap binding.dnsIssues and PRs related to the dns subsystem.feature requestIssues that request new features to be added to Node.js.

Type

No type

Projects

Status

Awaiting Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions