Unable to clear cache
Let's say I cache all the results for an hour. What would happen if you get a bad hostname that the library is not able to resolve for a minute but is available later. Would the bad result be cached for an hour? Example: Default config: dnscache = require('dnscache')({ "enable" : true, "ttl" : 3600, "cachesize" : 1000 }); Time 0: Hostname - cannot be resolved dnscache.lookup(hostname ..) => err (would the bad host be cached?) Time 5: Hostname - all up and ready to be resolved dnscache.lookup(hostname ..) => ? (would it pick up from the cache?)
If there is a way you could provide to clean up the cache
If you could add more documentation regarding the use of this library it would be appreciated. Like to return the value we need a callback or a promise based interface. The function is async ..
From my reading of the code, if the lookup failed then nothing will be put into the cache.
@drewfish @mirajshah05 use https://www.npmjs.com/package/lookup-dns-cache instead it's much more powerful