New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

axios-cached-dns-resolve

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-cached-dns-resolve - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "axios-cached-dns-resolve",
"version": "1.0.0",
"version": "1.0.1",
"description": "Caches dns resolutions made with async dns.resolve instead of default sync dns.lookup, refreshes in background",

@@ -5,0 +5,0 @@ "scripts": {

# axios-cached-dns-resolve
Axios uses node.js dns.resolve to resolve host names.
dns.resolve is synchronous and executes on limited libuv thread pool.
Axios uses node.js dns.lookup to resolve host names.
dns.lookup is synchronous and executes on limited libuv thread pool.
Every axios request will resolve the dns name in kubernetes, openshift, and cloud environments that intentionally set TTL low or to 0 for quick dynamic updates.
The dns resolvers can be overwhelmed with the load.
There is/was a bug in DNS resolver that manifests as very long dns.lookups in node.js.
There is/was a bug in DNS resolutions that manifests as very long dns.lookups in node.js.

@@ -26,2 +26,3 @@ From the kubernetes [documentation](https://kubernetes.io/docs/concepts/services-networking/service/#why-not-use-round-robin-dns)

* Constant DNS load/latency vs random load/variable latency
* Providing statistics and introspection

@@ -45,7 +46,8 @@ ## Requirements

axiosCachingDns.registerInterceptor(axiosClient)
registerInterceptor(axiosClient)
Use axiosClient as normal
```
Use axiosClient as normal
## Configuration

@@ -79,11 +81,25 @@

const stats = {
dnsEntries: 0,
refreshed: 0,
hits: 0,
misses: 0,
idleExpired: 0,
errors: 0,
lastError: 0,
lastErrorTs: 0,
"dnsEntries": 4,
"refreshed": 375679,
"hits": 128689,
"misses": 393,
"idleExpired": 279,
"errors": 0,
"lastError": 0,
"lastErrorTs": 0
}
const cacheEntries = [
{
"host": "foo-service.domain.com",
"ips": [
"51.210.235.165",
"181.73.135.40"
],
"nextIdx": 1,
"lastUsedTs": 1604151366910,
"updatedTs": 1604152691039
},
...
]
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc