Skip to main content
@layered/dns-records is a DNS helper library that can quickly discover and retrieve all DNS records for a domain.

What it does

This library provides simple, cross-runtime DNS record lookup and discovery capabilities. It can retrieve specific DNS record types (like A, TXT, or MX records) or discover all DNS records associated with a domain, including subdomains.

Key features

Cross-runtime support

Works seamlessly in browsers, Node.js, CloudFlare Workers, Deno, and Bun

Automatic discovery

Discovers almost all A, AAAA, CNAME, and TXT records for a domain with option to specify extra subdomains

Multiple DNS resolvers

Choose from Cloudflare DNS, Google DNS, Node.js native DNS, dig command, or Deno DNS

Wildcard detection

Automatically detects and handles wildcard (*) DNS records

Use cases

  • Domain analysis: Discover all DNS records associated with a domain for security audits or infrastructure mapping
  • DNS verification: Verify TXT records for domain ownership, SPF, DKIM, or other DNS-based authentication
  • Email server lookup: Find MX records to identify mail servers for a domain
  • Subdomain enumeration: Automatically discover subdomains through DNS record analysis
  • Multi-platform apps: Build DNS tools that work across different JavaScript runtimes

Live demo

See the library in action at dmns.app or try the Domain Info Chrome extension.

Next steps

Installation

Install the library in your project

Quickstart

Get started with your first DNS lookup

Build docs developers (and LLMs) love