Skip to content
This repository has been archived by the owner on Feb 13, 2021. It is now read-only.

Ttl cache from DNS server #14

Open
PaquitoSoft opened this issue Oct 26, 2016 · 6 comments
Open

Ttl cache from DNS server #14

PaquitoSoft opened this issue Oct 26, 2016 · 6 comments

Comments

@PaquitoSoft
Copy link

Hi!
Reading about the possibility to add caching capabilities to nodejs DNS module (which it seems it's not going to happen), there's a comment in this thread with a warning about dnscache module.
Here is the link to the thread.

Here is the comment:

Just to add my two cents in, it is very dangerous to use the dnscache package because it does not respect the ttl set by the dns server. This means that you could potentially have a bad dns cache for some time. By implementing a OS level solution, you'll get all the benefits mentioned above in addition to the reassurance that your dns entries will always be correct.

Is there any chance for this module to respect the TTL set by the DNS server?

Thanks.

@PaquitoSoft
Copy link
Author

I answer my own question.
Currently there's no way in nodejs to get the TTL set by the DNS server. However, it seems they will implement it, at least for the dns.resolve function (nodejs/node#9296)

@evantorrie
Copy link

Until this is supported by nodejs itself (7.2?), we are not going to add such a feature to this module. Instead, the assumption is that those using this module understand the risks involved with overriding the DNS server TTL. (In most cases, the expectation is that the TTL of dnscache will be set to a smaller value than most DNS server TTLs since its primary purpose is to prevent overloading/latency of said DNS servers).

@robertrossmann
Copy link

This is now supported as of Node.js 7.2 . Here are the docs for the new feature.

@SimenB
Copy link
Contributor

SimenB commented Jun 6, 2017

This was also backported to 6 today (6.11.0). https://github.com/nodejs/node/blob/4c5cbb7c8367abde6409ce68eee0e5eb5f07903d/doc/changelogs/CHANGELOG_V6.md#6.11.0

@eduardbme
Copy link

@WoZ
Copy link

WoZ commented Mar 25, 2019

@PaquitoSoft @evantorrie @robertrossmann @SimenB
@roccomuso

Hello! I've found that this module is unsupported and has some bugs. I may propose to use our module that was tested in production and highload environments. Also we have good unit and functional tests with 100% coverage, multi-records resolving and TTL support. Here it is: https://github.com/LCMApps/dns-lookup-cache

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants