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 🙏

© 2025 – Pkg Stats / Ryan Hefner

devns

v1.0.0

Published

Lightweight UDP DNS resolver proxy using Node.js built-in dns and dns-packet

Readme

DevNS

DevNS is a lightweight local DNS server for development purposes, it listens on UDP port 53 (configurable) and answers DNS queries by resolving them via Node's built-in dns module, with support for local hosts file overrides.

DevNS is developed by AI. Also a Tinkink project.

Features

  • Lightweight & Fast: Minimal dependencies, built on Node.js built-in modules
  • UDP DNS Server: Listens for DNS queries on configurable UDP port
  • Hosts File Support: Reads and watches system hosts file for local overrides
  • Multiple Record Types: Supports A, AAAA, CNAME, MX, NS, PTR, SRV, TXT, and ANY queries
  • Standard Logging: Clean console output with clear server status messages
  • Error Handling: Graceful error handling with automatic retry mechanisms
  • Production Ready: Suitable for both development and production environments

Installation

Global Installation (Recommended)

npm install -g devns

Local Installation

npm install devns

From Source

git clone <repository-url>
cd dns-server
npm install
npm run build

Usage

Command Line Options

devns [options]

Options:
  -p, --port <port>   UDP port to listen on (default: 53)
  -H, --host <host>   Host/IP to bind (default: 0.0.0.0)
  --ttl <seconds>     TTL for synthesized answers (default: 300)
  -h, --help          Show help

Examples

Development (Non-privileged port)

# Start server on port 1053 (no sudo required)
npx devns --port 1053

# Or if installed globally
devns --port 1053

Test with dig:

dig @127.0.0.1 -p 1053 example.com A
dig @127.0.0.1 -p 1053 google.com AAAA

Production (Port 53 requires elevated privileges)

# Start server on standard DNS port (requires sudo)
sudo devns --host 0.0.0.0 --port 53

Custom Host and TTL

devns --host 127.0.0.1 --port 5353 --ttl 600

Development Mode

If you're working on the source code:

# Install dependencies
npm install

# Run in development mode (auto-reload on changes)
npm run dev -- --port 1053

# Build for production
npm run build

# Run built version
npm start -- --port 1053

Supported DNS Record Types

The server supports the following DNS query types:

  • A: IPv4 address records
  • AAAA: IPv6 address records
  • CNAME: Canonical name records
  • MX: Mail exchange records
  • NS: Name server records
  • PTR: Pointer records (reverse DNS)
  • SRV: Service records
  • TXT: Text records
  • ANY: Returns all available record types

Hosts File Support

The server automatically reads and watches your system's hosts file:

  • Linux/macOS: /etc/hosts
  • Windows: C:/Windows/System32/drivers/etc/hosts

Any entries in the hosts file will override external DNS resolution. The server watches for changes and reloads the hosts file automatically.

Technical Details

  • Protocol: UDP (TCP not supported)
  • Maximum Response Size: 512 bytes (no EDNS support)
  • Recursive Resolver: Sets RA flag and copies RD from requests
  • Error Handling: Returns appropriate DNS response codes (NXDOMAIN, SERVFAIL, etc.)
  • Logging: Clean console output with server status and query information

Requirements

  • Node.js 16.0.0 or higher
  • UDP port access (port 53 for standard DNS, or any available port for development)

Security Notes

  • Running on port 53 requires elevated privileges (sudo/admin access)
  • The server only responds to UDP DNS queries and doesn't support TCP
  • Hosts file entries take precedence over external DNS resolution
  • No authentication or access control - ensure proper firewall configuration

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.