@octarahq/dnslookup
v1.0.0
Published
An enhanced DNS resolution module for Node.js with caching and structured responses.
Maintainers
Readme
About
dnslookup is a small Node.js module to perform asynchronous DNS queries (A, AAAA, CNAME, MX, TXT, etc.) with a built-in cache.
It is intended for integration into scripts, microservices, and networking tools where reliable and performant DNS resolution is required.
Features
- Asynchronous DNS queries based on
dns/promiseswith robust error handling. - Configurable TTL cache.
- Multi-type support (A, AAAA, MX, TXT, CNAME, etc.).
- JSON-friendly output suitable for APIs.
Installation
npm install @octarahq/dnslookupUsage
Basic example:
import { DNSLookup } from "@octarahq/dnslookup";
const dns = new DNSLookup();
// Simple A record lookup
const result = await dns.resolve("example.com", "A");
console.log(result);
// => [{ address: '93.184.216.34', ttl: 300 }]