@zeit/dns-cached-resolve
TypeScript icon, indicating that this package has built-in type declarations

2.1.2 • Public • Published

Caching DNS Resolver

CircleCI

Cache DNS A and AAAA record resolutions.

Example

index.js

async function run() {
  console.log('resolve("zeit.co")');
  for (let i = 0; i < 10; i++) {
    console.time('resolve');
    console.log('IP: ', await dnsResolve('zeit.co'));
    console.timeEnd('resolve');
  }
}
run().catch(console.error);
% node index.js
resolve("zeit.co")
IP:  54.153.55.116
resolve: 569.156ms
IP:  54.153.55.116
resolve: 0.256ms
IP:  54.153.55.116
resolve: 0.061ms
IP:  54.153.55.116
resolve: 0.036ms

Readme

Keywords

Package Sidebar

Install

npm i @zeit/dns-cached-resolve

Weekly Downloads

484,651

Version

2.1.2

License

Apache-2.0

Unpacked Size

16.9 kB

Total Files

11

Last publish

Collaborators

  • gdborton
  • matheuss
  • matt.straka
  • nick.tracey
  • zeit-bot
  • vercel-release-bot