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

dns: TTL for TXT entries #39399

Closed
martinheidegger opened this issue Jul 15, 2021 · 6 comments
Closed

dns: TTL for TXT entries #39399

martinheidegger opened this issue Jul 15, 2021 · 6 comments
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. stale

Comments

@martinheidegger
Copy link

The dns.lookupTxt() function returns the TXT entries but omits the TTL entries. This is a problem if one intends to add a cache on top of lookupTxt()

Describe the solution you'd like

Probably the best I could see is to have an option for lookupTxt in the form of { ttl: true } that returns a value + ttl object instead of a simple string:

dns.lookupTxt('domain', { ttl: true }, (err, data) => {
  data[0].value // text entry
  data[0].ttl // ttl number
})
@Ayase-252 Ayase-252 added dns Issues and PRs related to the dns subsystem. feature request Issues that request new features to be added to Node.js. labels Jul 16, 2021
@evanlucas
Copy link
Contributor

It doesn't look like cares supports this out of the box. c-ares/c-ares#393 seems to be some progress though.

I did find a patch thanks to @saghul's work on https://github.com/saghul/pycares that adds TTL support to cares, but it breaks ABI

@richardlau
Copy link
Member

#14713 is the Node.js issue tracking things "missing" from c-ares.

@targos
Copy link
Member

targos commented Jul 16, 2021

Also, #38184 could be the solution to many of these :)

@tniessen
Copy link
Member

tniessen commented Aug 8, 2021

Just copying #39528 (comment) from a duplicate issue:

For reference, the ttl option was discussed in #5893 and added in #9296.

The implementation appears to achieve this using ares_parse_a_reply and ares_parse_aaaa_reply, respectively. However, other parse functions, such as ares_parse_ns_reply, ares_parse_ptr_reply, ares_parse_mx_reply, ares_parse_txt_reply_ext, etc. do not appear to support retrieving the TTL of the records.

@tniessen tniessen added the cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. label Aug 8, 2021
@github-actions
Copy link
Contributor

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Mar 29, 2022
@targos targos moved this to Pending Triage in Node.js feature requests Mar 29, 2022
@targos targos moved this from Pending Triage to Stale in Node.js feature requests Mar 29, 2022
@github-actions
Copy link
Contributor

There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

For more information on how the project manages feature requests, please consult the feature request management document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. stale
Projects
None yet
Development

No branches or pull requests

6 participants