-
Notifications
You must be signed in to change notification settings - Fork 283
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: query for for authority section or additional section #634
Comments
@alexte I'm also looking for a way to get the AUTHORITY SECTION via Node. Since you are ahead with this issue, were you able to find a solution? |
The work arround to this issue was a library called "native-dns". But take care, it's a bit tricky! This library is not threaded save, so make only one query after the other. |
Yeah, I looked at this library too but I felt using another library instead the built in |
I feel like this should be a feature request to https://github.com/nodejs/node? |
(Asking detailed and direct API questions like this on the main repo is certainly ok.) |
Thanks @Fishrock123 for the heads up! |
I would definitely support the request for this feature, but I think it's quite unlikely. Hence this feature would be a rather big rewrite of the dns.js module. Perhaps a separate library is the correct place for this feature at the moment. |
It doesn’t look that way, yes. On the other hand DNS is a pretty simple protocol, it shouldn’t be hard to add support if we like, in Node or even upstream.
If you want to do this, I’d be more than glad to provide any assistance I can offer :) I have a pretty good understanding of how the current dns implementation in Node works, I’d say. |
OK great. I will give this project a second attempt, when I return from holiday. Some thoughts: You are right DNS is simple, but it is getting more complicated: Would the nodejs community prefer to stay with c-ares or rather like a native implementation like |
@alexte I’m not sure. As long as c-ares is working, I guess we’re sticking to that, and with very few exceptions Node explicitly encourages the existence of alternative userland implementations when that makes sense. |
There is no such thing as "authority queries" as far as I know, instead, each DNS message can contain an arbitrary number of authority RRs. c-ares partially supports authority RRs, the data is there, it's just that there is not really a lot of API around those RRs. If you don't feel like implementing something, I could give it a try @alexte, I already know some of the c-ares code. |
@tniessen your are right there is no authority queries, but every dns answer includes a "question" section and my include an "answer", "authority" and "additional" section. The counters per section in the packet are called "QDCOUNT", "ANCOUNT", "NSCOUNT" and "ARCOUNT" in the RFC and the c-ares source. After reading the source of c-ares it looks to me that the api helper functions like in "ares_parse_ns_reply.c", just use the QDCOUNT and ANCOUNT. NSCOUNT and ARCOUNT are I think it would be a very useful addition to c-ares, if you could implement that, but I don't know if the maintainers would include that ? |
@alexte Thanks, I know the structure of DNS messages :) However, I am not too sure about the constraints which the last two sections are subject to, so I tried to get in touch with the c-ares maintainers. We should probably await their response before taking any further action. Upate: Here is my inquiry to the team behind c-ares. (They should really enable UTF8 on their mail archives.) |
Will the new > dns.resolveAny('github.com', console.log)
QueryReqWrap {
...
}
> null [ { address: '192.30.253.113', ttl: 59, type: 'A' },
{ address: '192.30.253.112', ttl: 59, type: 'A' },
{ exchange: 'ALT1.ASPMX.L.GOOGLE.com', priority: 5, type: 'MX' },
{ exchange: 'ALT4.ASPMX.L.GOOGLE.com', priority: 10, type: 'MX' },
{ exchange: 'ASPMX.L.GOOGLE.com', priority: 1, type: 'MX' },
{ exchange: 'ALT2.ASPMX.L.GOOGLE.com', priority: 5, type: 'MX' },
{ exchange: 'ALT3.ASPMX.L.GOOGLE.com', priority: 10, type: 'MX' },
{ value: 'ns4.p16.dynect.net', type: 'NS' },
{ value: 'ns2.p16.dynect.net', type: 'NS' },
{ value: 'ns-421.awsdns-52.com', type: 'NS' },
{ value: 'ns-1283.awsdns-32.org', type: 'NS' },
{ value: 'ns1.p16.dynect.net', type: 'NS' },
{ value: 'ns-1707.awsdns-21.co.uk', type: 'NS' },
{ value: 'ns3.p16.dynect.net', type: 'NS' },
{ value: 'ns-520.awsdns-01.net', type: 'NS' },
{ entries: [ 'docusign=087098e3-3d46-47b7-9b4e-8a23028154cd' ],
type: 'TXT' },
{ entries: [ 'v=spf1 ip4:192.30.252.0/22 include:_spf.google.com include:esp.github.com include:_spf.createsend.com include:mail.zendesk.com include:servers.mcsv.net ~all' ],
type: 'TXT' },
{ nsname: 'ns1.p16.dynect.net',
hostmaster: 'hostmaster.github.com',
serial: 1501060715,
refresh: 3600,
retry: 600,
expire: 604800,
minttl: 60,
type: 'SOA' } ] |
@refack Not really, it is not the same.
|
@refack : as @tniessen says resolveAny just gives you the answer section and not the authority section. BTW: the QTYPE=ANY will propably fail sooner or later, because it leads to DDoS amplification due to |
Should we then have a " |
We already have a tracking issue for this, so closing in favor of nodejs/node#14713 |
Is it possible to get the additional Authority Section and Additinal Section from an
TLD or root name server using the dns module in nodejs?
Results in "ENODATA"
This is actually correct because the .com TLD name server "192.33.14.30" does not answer
a direct query. But it would answer with an "authority section":
I am currently working on a service that is checking if domains are registered correctly. And for this I'm comparing my local NS list to the authorativ NS records in the TLD.
The text was updated successfully, but these errors were encountered: