npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@opsimathically/dnsinfo

v0.0.1

Published

Retrieve DNS and RDNS information from arbitrary servers.

Readme

DNSInfo

dnsinfo is a TypeScript package for forward DNS and reverse DNS discovery across one or more DNS resolvers.

It supports:

  • Multiple resolvers in one request
  • Per-resolver ports
  • IPv4 and IPv6 resolver endpoints
  • IPv4 and IPv6 lookup targets
  • Results grouped by resolver, then target, then record type

Install

npm install @opsimathically/dnsinfo

Quick Usage

Forward DNS Lookup (Multiple Resolvers)

import { GetDnsRecords } from '@opsimathically/dnsinfo';

async function ExampleForwardLookup(): Promise<void> {
  const dns_results = await GetDnsRecords({
    resolvers: [
      {
        resolver_id: 'google_ipv4',
        resolver_host: '8.8.8.8',
        resolver_port: 53
      },
      '[2001:4860:4860::8888]:53'
    ],
    targets: ['example.com', '1.1.1.1', '2606:4700:4700::1111'],
    record_types: ['A', 'AAAA', 'MX', 'TXT', 'PTR'],
    timeout_ms: 3000,
    max_retries: 1,
    concurrency_limit: 25
  });

  console.log(JSON.stringify(dns_results, null, 2));
}

void ExampleForwardLookup();

Reverse DNS Lookup (PTR)

import { GetReverseDnsRecords } from '@opsimathically/dnsinfo';

async function ExampleReverseLookup(): Promise<void> {
  const reverse_dns_results = await GetReverseDnsRecords({
    resolvers: ['1.1.1.1:53', '8.8.8.8:53'],
    targets: ['8.8.8.8', '2001:4860:4860::8888'],
    timeout_ms: 3000,
    max_retries: 1,
    concurrency_limit: 25
  });

  console.log(JSON.stringify(reverse_dns_results, null, 2));
}

void ExampleReverseLookup();

Public API

  • GetDnsRecords(params)
  • GetDnsRecordsFromResolvers(params)
  • GetReverseDnsRecords(params)

Input types:

  • dns_lookup_request_t
  • reverse_dns_lookup_request_t

Output types:

  • dns_lookup_response_t
  • reverse_dns_lookup_response_t

Resolver Input Formats

Resolvers can be supplied in either format:

// Object form
{ resolver_id: 'quad9', resolver_host: '9.9.9.9', resolver_port: 53 }

// String form (IPv4/hostname)
'8.8.8.8:53'
'dns.example.net:53'

// String form (IPv6)
'[2001:4860:4860::8888]:53'

Response Shape

Each response includes request timestamps and resolver_results. Each resolver includes target_results. Each target includes record_results with:

  • record_type
  • status (success, empty, error)
  • answers
  • latency_ms
  • queried_at
  • error_code and error_message when status is error

Runtime Validation

The package validates incoming request payloads at runtime using zod schemas generated by ts-to-zod.

To regenerate schemas:

npm run ts-to-zod

Build and Test

npm run test
npm run build

Additional Examples

  • test/dns_lookup/index.test.ts