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

@warren-bank/dns-server

v2.0.1

Published

A tiny DNS server. Supports a 'hosts' JSON data file. Supports a fallback DNS server.

Readme

dns-server

A tiny DNS server. Supports a 'hosts' JSON data file. Supports a fallback DNS server.


Installation:

npm install --global @warren-bank/dns-server

Usage:

dns-server <options>

========
options:
========
"--help"
    Print a summary of all command-line options.

"-v"
"--version"
    Print the current version.

"-d"
"--debug"
    Print a log of each request.

"-h" <filepath>
"--hosts-file" <filepath>
    Specify path to input 'hosts' JSON file.

"-H" <host [=] IP>
"--host" <host [=] IP>
    Specify a single 'hosts' key/value pair.
    [option can be used more than once]

"-p" <number>
"--port" <number>
    Specify port number for DNS server.
    [default: 53]

"-f" <IP>
"--fallback-server" <IP>
    Specify fallback DNS server
    to resolve hostnames not found in "--hosts-file".
    [default: "1.1.1.1"]

Input 'hosts' JSON file:

  • Object that maps host names (keys) to IP addresses (values)
  • both keys and values are strings
  • keys are not case sensitive
    • when a key begins with the ^ character
      • it is converted to a regular expression
      • all host names that match this regex key are resolved to its corresponding IP address value
    • otherwise
      • only host names that match this exact string value are resolved to its corresponding IP address value

Examples:

  • of specifying a hosts.json file
      dns-server \
        -h "/path/to/hosts.json"
  • of specifying 'hosts' mappings without a hosts.json file:
      dns-server \
        -H "foo.local = 192.168.0.101" \
        -H "bar.local = 192.168.0.102" \
        -H "baz.local = 192.168.0.103"

Credits:

  • dns2 by Liu Song
    • his library does absolutely all of the heavy lifting
    • his examples show how all of the necessary wiring is done
    • this library just adds a command-line interface and some very simple logic for processing the input 'hosts' JSON file

Legal: