Repository navigation
Add dns.resolve that returns all results #2848
Description
Activity
- addeddnsIssues and PRs related to the dns subsystem.Issues and PRs related to the dns subsystem.feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Sep 13, 2015 resolvealready returns an array of results, what's exactly the issue?Unless I'm mistaken,
resolvereturns an array of results for one record type (like A, AAAA, CNAME, MX, etc). I'd like to be able to do a wildcard query, supported by c-ares with thens_t_anytype.Oh, you're talking about the
ANYquery. Well, that'd be indeed something we should support imho.Sounds good. This isn't super critical for me atm.
Work is still ongoing with the js dns resolver. If it's a simple change and someone wants to add it for c-ares in the meantime, feel free to do so.
- addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on Sep 24, 2015 This shouldn't be too hard to add.
dns.resolveshould take a new rrtypeANY, and we likely want aresolveAnymethod as well.On the other hand, there is the issue that we need to return the rrtype of the various records to the user, but we can't really change the
addressesarray ondns.resolveto something else. Maybe this special query should live only asresolveAnywhere we could return an array of objects like[ {rrtype: 'A', record: 'something.com'}, {rrtype: 'MX', record: 'mx.something.com'}, ]
Is anyone working on adding this? If not, I can work on this. (cc: @jasnell, @silverwind )
On the other hand, there is the issue that we need to return the rrtype of the various records to the user, but we can't really change the addresses array on dns.resolve to something else.
Correct me if I'm wrong but
dns.resolve()already returns differently shaped arrays for different query types, doesn't it? Having ANY records have a different shape doesn't look like an issue to me.$ node -e 'require("dns").resolve("google.com", "A", console.log)' null [ '74.125.136.138', '74.125.136.113', '74.125.136.139', '74.125.136.101', '74.125.136.102', '74.125.136.100' ] $ node -e 'require("dns").resolve("google.com", "MX", console.log)' null [ { exchange: 'alt1.aspmx.l.google.com', priority: 20 }, { exchange: 'aspmx.l.google.com', priority: 10 }, { exchange: 'alt3.aspmx.l.google.com', priority: 40 }, { exchange: 'alt2.aspmx.l.google.com', priority: 30 }, { exchange: 'alt4.aspmx.l.google.com', priority: 50 } ]25 remaining items
@silverwind I'm working on it now at #13137.
- added 2 commits that reference this issue
on Jun 24, 2017
Similar to #736, it'd be nice if we had a
dns.resolvethat queries for all results.Would the Node core maintainers be amenable to a pr that adds this functionality via c-ares, or should such an addition be delayed until after #1013 has been resolved?