dns-cache

JSON →
library 2.0.0 ·javascript
verified Jun 7, 2026

Simple DNS cache for Node.js that automatically caches all dns.lookup calls with configurable TTL. Current stable version is 2.0.0, compatible with Node.js >=0.12.0. Version 2.0.0 is not backwards compatible with Node.js <0.12 due to changes in dns.lookup. For Node.js 0.10 and older, use version 1.0.0. This package addresses DNS lookup conflicts (see joyent/node#7729) and improves performance by reducing redundant DNS queries. It is lightweight, easy to use (just require once), and accepts a TTL in milliseconds.