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

@joseph.andrade.ii/dns-lookup-mcp

v1.0.0

Published

MCP server for performing DNS lookups with TypeScript

Readme

DNS Lookup MCP Server

A TypeScript-based Model Context Protocol (MCP) server that provides DNS lookup capabilities for AI assistants like Claude.

Features

  • DNS Lookups: Query various DNS record types (A, AAAA, CNAME, MX, TXT, NS, PTR, SOA, SRV, CAA)
  • Reverse DNS: Perform reverse DNS lookups on IP addresses
  • Bulk Resolution: Resolve all common record types for a hostname at once
  • Custom DNS Servers: Optionally specify custom DNS servers for queries
  • TypeScript: Fully typed for better development experience

Installation

From npm

npm install -g @yourusername/dns-lookup-mcp

From Source

git clone https://github.com/yourusername/dns-lookup-mcp.git
cd dns-lookup-mcp
npm install
npm run build
npm link

Usage with Claude Code CLI

1. Configure MCP Settings

Add the DNS lookup server to your Claude Code MCP settings file (~/.config/claude-code/mcp.json or appropriate path for your OS):

{
  "mcpServers": {
    "dns-lookup": {
      "command": "npx",
      "args": ["@yourusername/dns-lookup-mcp"]
    }
  }
}

Or if installed globally:

{
  "mcpServers": {
    "dns-lookup": {
      "command": "dns-lookup-mcp"
    }
  }
}

2. Restart Claude Code

After updating the configuration, restart Claude Code to load the new MCP server.

3. Available Tools

The server provides three main tools:

dns_lookup

Perform DNS lookup for a hostname with specified record type.

Parameters:

  • hostname (required): The hostname to look up
  • recordType (optional): DNS record type (A, AAAA, CNAME, MX, TXT, NS, PTR, SOA, SRV, CAA, ANY)
  • timeout (optional): Query timeout in milliseconds (default: 5000)
  • servers (optional): Array of custom DNS servers to use

Example usage in Claude:

Use the dns_lookup tool to find the A records for example.com

reverse_dns

Perform reverse DNS lookup for an IP address.

Parameters:

  • ip (required): The IP address to perform reverse lookup on

Example usage in Claude:

Use the reverse_dns tool to find the hostname for IP 8.8.8.8

dns_resolve_all

Resolve all common DNS record types for a hostname.

Parameters:

  • hostname (required): The hostname to resolve all records for

Example usage in Claude:

Use the dns_resolve_all tool to get all DNS records for google.com

Development

Setup

# Clone the repository
git clone https://github.com/yourusername/dns-lookup-mcp.git
cd dns-lookup-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

Testing Locally

You can test the MCP server locally by running:

# Run directly with tsx (development)
npm run dev

# Or build and run
npm run build
node dist/index.js

The server communicates via stdio, so you'll need an MCP client to interact with it properly.

Publishing to npm

1. Prepare Your Package

  1. Update package.json:

    • Replace @yourusername with your npm username
    • Update author, repository, and homepage URLs
    • Set the appropriate version number
  2. Create an npm account if you don't have one:

    npm adduser
  3. Login to npm:

    npm login

2. Publish

# Build the project
npm run build

# Publish to npm
npm publish --access public

3. Version Management

To update and publish a new version:

# Patch version (1.0.0 -> 1.0.1)
npm version patch

# Minor version (1.0.0 -> 1.1.0)
npm version minor

# Major version (1.0.0 -> 2.0.0)
npm version major

# Publish the new version
npm publish

Integration Examples

Example 1: Using with Claude Code CLI

Once configured, you can ask Claude to perform DNS lookups:

User: Can you look up the DNS records for github.com?

Claude: I'll use the DNS lookup tool to check the DNS records for github.com.
[Uses dns_resolve_all tool]

Example 2: Custom Configuration

For advanced users, you can configure the server with environment variables:

{
  "mcpServers": {
    "dns-lookup": {
      "command": "npx",
      "args": ["@yourusername/dns-lookup-mcp"],
      "env": {
        "DNS_TIMEOUT": "10000",
        "DEFAULT_DNS_SERVERS": "8.8.8.8,1.1.1.1"
      }
    }
  }
}

Troubleshooting

Server Not Starting

  1. Check that Node.js version is >= 18.0.0
  2. Ensure all dependencies are installed: npm install
  3. Check the MCP configuration file syntax

DNS Queries Timing Out

  1. Increase the timeout parameter in your queries
  2. Check your network connection
  3. Try using different DNS servers

TypeScript Build Errors

  1. Ensure TypeScript is installed: npm install -D typescript
  2. Check that all type definitions are installed
  3. Run npm run clean and rebuild

Contributing

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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions:

Acknowledgments