Skip to main content
Glama
badchars

osint-mcp-server

by badchars

dns_lookup

Resolve DNS records for domains to analyze infrastructure, verify configurations, and investigate network security. Supports A, AAAA, MX, TXT, NS, SOA, CNAME, and SRV record types.

Instructions

Resolve DNS records for a domain. Supports A, AAAA, MX, TXT, NS, SOA, CNAME, SRV record types.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain name to query
typeYesDNS record type

Implementation Reference

  • The main implementation of the dns_lookup tool handler, which uses Node's native dns/promises module to resolve various DNS record types.
    export async function dnsLookup(domain: string, type: string): Promise<DnsRecord[]> {
      const records: DnsRecord[] = [];
    
      switch (type.toUpperCase()) {
        case "A": {
          const ips = await dns.resolve4(domain);
          for (const ip of ips) records.push({ type: "A", value: ip });
          break;
        }
        case "AAAA": {
          const ips = await dns.resolve6(domain);
          for (const ip of ips) records.push({ type: "AAAA", value: ip });
          break;
        }
        case "MX": {
          const mxs = await dns.resolveMx(domain);
          for (const mx of mxs) records.push({ type: "MX", value: mx.exchange, priority: mx.priority });
          break;
        }
        case "TXT": {
          const txts = await dns.resolveTxt(domain);
          for (const txt of txts) records.push({ type: "TXT", value: txt.join("") });
          break;
        }
        case "NS": {
          const nss = await dns.resolveNs(domain);
          for (const ns of nss) records.push({ type: "NS", value: ns });
          break;
        }
        case "SOA": {
          const soa = await dns.resolveSoa(domain);
          records.push({
            type: "SOA",
            value: `${soa.nsname} ${soa.hostmaster} ${soa.serial} ${soa.refresh} ${soa.retry} ${soa.expire} ${soa.minttl}`,
          });
          break;
        }
        case "CNAME": {
          const cname = await dns.resolveCname(domain);
          for (const c of cname) records.push({ type: "CNAME", value: c });
          break;
        }
        case "SRV": {
          const srvs = await dns.resolveSrv(domain);
          for (const s of srvs) {
            records.push({ type: "SRV", value: s.name, priority: s.priority, weight: s.weight, port: s.port });
          }
          break;
        }
        default:
          throw new Error(`Unsupported DNS record type: ${type}`);
      }
    
      return records;
    }
  • Registration of the dns_lookup tool in the MCP protocol tools definition file.
    const dnsLookupTool: ToolDef = {
      name: "dns_lookup",
      description: "Resolve DNS records for a domain. Supports A, AAAA, MX, TXT, NS, SOA, CNAME, SRV record types.",
      schema: {
        domain: z.string().describe("Domain name to query"),
        type: z.enum(["A", "AAAA", "MX", "TXT", "NS", "SOA", "CNAME", "SRV"]).describe("DNS record type"),
      },
      execute: async (args) => json(await dnsLookup(args.domain as string, args.type as string)),
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the action ('Resolve') and supported record types, but fails to disclose behavioral traits such as rate limits, authentication needs, error handling, or what the output looks like (e.g., format, pagination). This is a significant gap for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, consisting of two concise sentences that directly state the purpose and supported features without any wasted words. Every sentence earns its place by providing essential information efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 parameters, no nested objects) and 100% schema coverage, the description is somewhat complete but lacks output details (no output schema) and behavioral context. It adequately covers the basics but misses opportunities to enhance usability, such as explaining return formats or common use cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for both parameters ('domain' and 'type'), including an enum for 'type'. The description adds minimal value by listing the enum values, but doesn't provide additional semantics beyond what the schema already documents, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Resolve') and resource ('DNS records for a domain'), specifying what the tool does. It distinguishes itself by listing supported record types, which helps differentiate it from some siblings like 'dns_reverse' or 'dns_email_security', but doesn't explicitly contrast with all DNS-related tools in the list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. With many sibling tools (e.g., 'dns_reverse', 'dns_spf_chain', 'shodan_dns_resolve'), the description lacks context on specific use cases, prerequisites, or exclusions, leaving the agent to infer usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/badchars/osint-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server