DNS MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DNS MCP Server show me the MX records for example.com"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DNS MCP Server
A DNS query MCP server built with FastMCP, supporting cross-platform operation (Windows/Linux/macOS) and customizable upstream DNS servers.
Features
π Support for multiple DNS record types (A, AAAA, MX, CNAME, TXT, NS, SOA)
π Cross-platform support (Windows/Linux/macOS)
βοΈ Configurable upstream DNS servers via environment variables or command line parameters
π High performance using FastMCP framework
π¦ Dependency management with uv
Related MCP server: DNS MCP Server
Installation
Using uv (Recommended)
uv syncUsing pip
pip install -r requirements.txtUsage
1. Using System Default DNS Servers
Using uv:
uv run dns-mcpUsing Python:
python -m dns_mcp.server2. Specifying DNS Servers via Command Line
Using uv:
uv run dns-mcp --dns-servers 8.8.8.8 1.1.1.1Using Python:
python -m dns_mcp.server --dns-servers 8.8.8.8 1.1.1.13. Specifying DNS Servers via Environment Variables
# Windows
set DNS_MCP_SERVERS=8.8.8.8,1.1.1.1
# Linux/macOS
export DNS_MCP_SERVERS=8.8.8.8,1.1.1.1Then run:
# Using uv
uv run dns-mcp
# Using Python
python -m dns_mcp.serverMCP Tools
dns_query
Query DNS records for a specified hostname.
Install
"mcpServers": {
"dns-mcp": {
"command": "uv",
"args": [
"--directory", "PATH_TO_SOURCES",
"run", "dns-mcp"
]
}
}Parameters
host(required): The hostname to query (e.g., 'example.com')type(optional): DNS record type, defaults to 'A'
Supported Record Types
A: IPv4 address records
AAAA: IPv6 address records
MX: Mail exchange records
CNAME: Canonical name records
TXT: Text records
NS: Name server records
SOA: Start of authority records
Response Format
{
"host": "example.com",
"type": "A",
"success": true,
"records": ["93.184.216.34"],
"ttl": 86400,
"upstream_servers": ["8.8.8.8", "8.8.4.4"]
}Usage Examples
# Query A record
result = await dns_query("example.com")
# Query MX record
result = await dns_query("example.com", "MX")
# Query TXT record
result = await dns_query("example.com", "TXT")Configuration Options
Environment Variables
DNS_MCP_SERVERS: Comma-separated list of upstream DNS servers
Command Line Arguments
--dns-servers: Specify upstream DNS servers (space-separated)--port: Specify MCP server port (default: 3000)
System DNS Server Detection
The server automatically detects system DNS configuration:
Windows: Uses
nslookupcommand to get system DNS settingsLinux: Reads
/etc/resolv.conffilemacOS: Uses
scutil --dnsandnetworksetupcommands to detect DNS serversFallback: If system settings cannot be detected, falls back to Google Public DNS (8.8.8.8, 8.8.4.4)
Development
Install Development Dependencies
uv sync --devLicense
MIT License
Example Client
Here's a simple client example demonstrating how to use this DNS MCP server:
import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def main():
server_params = StdioServerParameters(
command="uv",
args=["run", "dns-mcp"]
)
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
# Initialize connection
await session.initialize()
# Query A record
result = await session.call_tool("dns_query", {
"host": "example.com",
"type": "A"
})
print(f"A record: {result}")
# Query MX record
result = await session.call_tool("dns_query", {
"host": "example.com",
"type": "MX"
})
print(f"MX record: {result}")
if __name__ == "__main__":
asyncio.run(main())Contributing
Pull requests and issue reports are welcome!
Available Tools
1 tooldns_queryDns QueryB
Query DNS records for a hostname.
Inputs: host (required), type. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 1 tool
There is only one tool, so there are no overlapping purposes or selection ambiguity. An agent cannot confuse dns_query with another operation in this server.
The sole tool uses clear snake_case naming. With only one tool there is no inconsistent convention to compare against.
A single-tool DNS server is borderline thin. It may cover basic lookups, but the surface feels under-scoped for a general DNS MCP server.
The tool supports forward DNS record queries, but obvious complementary operations such as reverse lookup or DNS diagnostics are absent. It is usable for basic querying but leaves notable gaps.
Maintenance
Related MCP Connectors
Look up DNS information for any domain to troubleshoot issues and gather insights. Get fast, reliaβ¦
Look up DNS records, diagnose domain configuration, and save DNS snapshots.
Unlock the power of DNS lookups with our DNS Lookup service using Google DNS-over-HTTPS. Whether
Live DNS lookups for agents: A/MX/TXT/SPF/CNAME/PTR with TTLs and DNSSEC, via Google Public DNS.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol tool that provides DNS querying capabilities for various record types (A, AAAA, MX, TXT, CNAME, NS, etc.) through a standardized MCP interface.1MIT
- AlicenseAqualityDmaintenanceEnables comprehensive DNS operations including lookups for various record types, reverse DNS queries, batch processing, and DNS resolution tracing. Supports multiple DNS servers with configurable caching and robust error handling.411 npm2MIT
- FlicenseNot gradedqualityCmaintenanceA comprehensive DNS query server that enables querying all types of DNS records, including A, AAAA, MX, TXT, NS, CNAME, SOA, PTR, SRV, CAA, and DNSSEC checks, as well as advanced tools like WHOIS-style lookup and DNS delegation tracing.1-
- FlicenseAqualityDmaintenanceProvides comprehensive DNS lookup capabilities including A, AAAA, MX, TXT, NS, SOA, CNAME, SRV, CAA, DNSSEC records, reverse DNS lookups, and bulk queries for multiple domains or IPs.4-