Skip to content

dns: TTL for TXT entries #39399

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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 requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions