Skip to content

dns: TTL for TXT entries #39399

Closed
Closed
@martinheidegger

Description

@martinheidegger

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
})

Metadata

Metadata

Assignees

No one assigned

    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.stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions