Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking Change - DNS Caching #57636

Open
ronag opened this issue Mar 26, 2025 · 3 comments · May be fixed by #57640
Open

Breaking Change - DNS Caching #57636

ronag opened this issue Mar 26, 2025 · 3 comments · May be fixed by #57640
Assignees

Comments

@ronag
Copy link
Member

ronag commented Mar 26, 2025

dns.resolve will cache lookups due to a semver major breaking change.

Probably related to:

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.

Seems to have been introduced a semver minor change somewhere around 20.16.

@ronag
Copy link
Member Author

ronag commented Mar 26, 2025

Problem probably introduced with c5174f5e60

@ronag
Copy link
Member Author

ronag commented Mar 26, 2025

@nodejs/dns

@ronag
Copy link
Member Author

ronag commented Mar 26, 2025

We should probably set qcache_max_ttl=0

@Ethan-Arrowood Ethan-Arrowood self-assigned this Mar 26, 2025
Ethan-Arrowood added a commit to Ethan-Arrowood/node that referenced this issue Mar 26, 2025
Fixes: nodejs#57636

When c-ares was [updated](nodejs@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.
@Ethan-Arrowood Ethan-Arrowood linked a pull request Mar 26, 2025 that will close this issue
Ethan-Arrowood added a commit to Ethan-Arrowood/node that referenced this issue Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants