-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Native DNS caching for lookups #5893
Comments
What about using dnsmasq? Also for |
@mscdex In regards to custom |
+1 |
While this sounds nice, and i'd love to have an option to just 'turn on fast DNS'. Just set up a local resolver, let it do what it does best. As a bonus your whole system will operate faster. |
@justsml You wouldn't have to use it system-wide unless you wanted to. node's |
@justsml I'm in favor of a local resolver as well, just calling this out if it was worth bringing it up. Thanks. |
I'm -1 on this, this is something that userland modules should solve and caching bugs are worse than performance bugs. I think the caching should be done outside the dns module anywy - as in - the DNS module always works "as advertised" and performs a clean lookup to the nameservers. |
Here is a userland solution that works https://www.npmjs.com/package/dnscache |
Given the responses it's unlikely that we'll end up doing this. Going to close. Feel free to reopen if necessary. |
Just to add my two cents in, it is very dangerous to use the |
@reallistic couldn't |
@jbergstroem what I mean is that I agree with the comments above that this shouldn't fall on Node.js' hands and also warning that the |
Based on the comments exposed here about not implementing DNS cache on nodejs core and the comment from @reallistic about potential problems using dnscache module, I would like to know how can we get the TTL set from the DNS server so we can correctly implement DNS caching in our applications. Thanks! |
@PaquitoSoft |
@bnoordhuis thanks! |
@PaquitoSoft I highly recommend fixing this at the OS level. Using bind, dnsmasq, or something similar. |
Add an option to retrieve the Time-To-Live of the A record. PR-URL: nodejs#9296 Refs: nodejs#5893 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Add an option to retrieve the Time-To-Live of the AAAA record. PR-URL: nodejs#9296 Refs: nodejs#5893 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Add an option to retrieve the Time-To-Live of the A record. PR-URL: nodejs/node#9296 Refs: nodejs/node#5893 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Add an option to retrieve the Time-To-Live of the AAAA record. PR-URL: nodejs/node#9296 Refs: nodejs/node#5893 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Take a look at https://www.npmjs.com/package/lookup-dns-cache |
@bnoordhuis can this be closed given that #9296 landed? |
@benjamingr It's closed already. |
We released 🍊 Tangerine today, which is a userland package npm install tangerine -import dns from 'dns';
+import Tangerine from 'tangerine';
- const resolver = new dns.promises.Resolver();
+const resolver = new Tangerine(); Documentation, API, options, source code, tests, benchmarks, and more available at https://github.com/forwardemail/tangerine. |
Will we ever see caching in the native dns module? We have noticed a decent amount of overhead when making many parallel calls to the same dns and the dns module is doing lookups.
I understand the idea around this module is to be unopinionated but it might be a feature typical users might want to enable w/o using something like bind.
The text was updated successfully, but these errors were encountered: