Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vercel/dns-cached-resolve
Caching DNS resolver
https://github.com/vercel/dns-cached-resolve
Last synced: 14 days ago
JSON representation
Caching DNS resolver
- Host: GitHub
- URL: https://github.com/vercel/dns-cached-resolve
- Owner: vercel
- License: apache-2.0
- Created: 2017-10-18T20:35:14.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T01:00:34.000Z (over 1 year ago)
- Last Synced: 2024-12-17T23:23:16.902Z (18 days ago)
- Language: TypeScript
- Size: 776 KB
- Stars: 44
- Watchers: 56
- Forks: 9
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Caching DNS Resolver
====================[![CircleCI](https://circleci.com/gh/zeit/dns-cached-resolve.svg?style=svg)](https://circleci.com/gh/zeit/dns-cached-resolve)
Cache DNS A and AAAA record resolutions.
## Example
**index.js**
```javascript
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);
``````bash
% 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
```