-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Add dns.resolve that returns all results #2848
Comments
|
Unless I'm mistaken, |
Oh, you're talking about the |
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. |
This shouldn't be too hard to add. |
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 [
{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 ) |
Correct me if I'm wrong but
|
@bnoordhuis you're correct. Won't be an issue for this addition. I was wrongly assuming we always return arrays for |
So basically this 'resolveAny' query should return this right
Does above example look right? Can you please provide a example if it needs correction? @silverwind @bnoordhuis |
I'd make every entry an object with at least a record type field. |
I'd do something like this:
Maybe you can lean on existing property names, but generally I'd follow a scheme like @bnoordhuis mentioned, with |
@silverwind that example helps. I will follow this pattern as it makes sense:
|
@kulkarniankita: for things like
|
@kulkarniankita are you working on this? If not, I'd be interested in implementing it myself. |
@silverwind yes I am working on this |
How's your progress on this, @kulkarniankita? |
Hi, I was stuck for a while on this one. @jasnell is helping answer some questions. I should be able to get it done sooner now. Thanks. |
I feel guity for labeling this a good first contribution, sorry for the trouble. 😅 |
@silverwind Nevertheless, good learning experience! Can I request some mentoring from you @silverwind |
Let's see, the addition should be similar to when the last two query types were added which according to So the main challenge here will be the C++ function
|
Also I just found out there's an
For 99.99% of purposes, we can assume |
As far as I can tell the c-ares wrappers are pretty simple;
However, looking at the documentation for c-ares there's no parser for for the Is this the way to do or should the the wrappers be refactored to expose their cc: @silverwind |
By the way @silverwind if you end up starting the implementation let me know I'd like to help/discuss. I'll probably be on IRC. |
@Chris911 I'd say re-using code where possible sounds like a good idea. The returned records should be as close as possible in formatting to the current methods for each record type. I'd say if @kulkarniankita is okay with it, feel free to take a shot at an implementation. I'm very rarely on IRC, so would prefer to discuss things here on GitHub. Oh, and I have to mention that we have #1843 queued up which will likely replace c-ares in the long run, but last I've heard there are still some performance issues with the JS DNS. The motivations for it were because c-ares is plagued by an unresolved a crash issue and generally looks to be on the unmaintained side. |
Alright. I started working on the implementation and have something working but there's a lot of duplicated code. This would require a big refactor to share the parse functions. I saw #1843 the other and might skip the C++ refactor as it might be replaced shortly. Thanks for your time. Will keep looking for good first contributions (don't hesitate to ping me if you see something 😛) |
Hm this issue has been bounced around a lot. Are any of you still working on this, and is any of that work public? |
Doesn't look like anyone is actively working on this. If anyone wants to take it, let us know. |
Hello @silverwind, is this still a good contribution? I'm interested in getting involved with Node in my spare time. Thanks |
Sure, go ahead! |
Just FYI, I am still working on this; I just don't always have a lot of time due to my day job so it may take me a minute to come up to speed. |
I'm going through and reading the nodejs docs on dns, previous commits for soa and naptr, the c-ares docs, etc. Are there any other docs I should also take a look at as I work this (or helpful blogs, etc)? Thanks! |
I agree the ANY type record is a must, as you may not know if a record is a CNAME or A |
@silverwind I'm working on it now at #13137. |
`dns.resolveAny` and `dns.resolve` with `"ANY"` has the similar behavior like `$ dig <domain> any` and returns an array with several types of records. `dns.resolveAny` parses the result packet by several rules in turn. Supported types: * A * AAAA * CNAME * MX * NAPTR * NS * PTR * SOA * SRV * TXT Refs: nodejs#2848
`dns.resolveAny` and `dns.resolve` with `"ANY"` has the similar behavior like `$ dig <domain> any` and returns an array with several types of records. `dns.resolveAny` parses the result packet by several rules in turn. Supported types: * A * AAAA * CNAME * MX * NAPTR * NS * PTR * SOA * SRV * TXT Fixes: #2848 PR-URL: #13137 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`dns.resolveAny` and `dns.resolve` with `"ANY"` has the similar behavior like `$ dig <domain> any` and returns an array with several types of records. `dns.resolveAny` parses the result packet by several rules in turn. Supported types: * A * AAAA * CNAME * MX * NAPTR * NS * PTR * SOA * SRV * TXT Fixes: #2848 PR-URL: #13137 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`dns.resolveAny` and `dns.resolve` with `"ANY"` has the similar behavior like `$ dig <domain> any` and returns an array with several types of records. `dns.resolveAny` parses the result packet by several rules in turn. Supported types: * A * AAAA * CNAME * MX * NAPTR * NS * PTR * SOA * SRV * TXT Fixes: #2848 PR-URL: #13137 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`dns.resolveAny` and `dns.resolve` with `"ANY"` has the similar behavior like `$ dig <domain> any` and returns an array with several types of records. `dns.resolveAny` parses the result packet by several rules in turn. Supported types: * A * AAAA * CNAME * MX * NAPTR * NS * PTR * SOA * SRV * TXT Fixes: #2848 PR-URL: #13137 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Similar to #736, it'd be nice if we had a
dns.resolve
that 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?
The text was updated successfully, but these errors were encountered: