Skip to main content
Glama
badchars

osint-mcp-server

by badchars

dns_lookup

Resolve DNS records for a domain, supporting A, AAAA, MX, TXT, NS, SOA, CNAME, and SRV 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 core implementation of dns_lookup. Uses Node.js built-in node:dns/promises to resolve DNS records. Supports A, AAAA, MX, TXT, NS, SOA, CNAME, and SRV record types. Returns an array of DnsRecord objects.
    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;
    }
  • Tool definition and schema for dns_lookup. Defines the tool name 'dns_lookup', description, Zod schema for 'domain' (string) and 'type' (enum of A/AAAA/MX/TXT/NS/SOA/CNAME/SRV), and the execute handler that calls dnsLookup().
    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)),
    };
  • Registration of dns_lookup in the exported allTools array. The dnsLookupTool is included as the first entry in the DNS tools group (line 483).
    export const allTools: ToolDef[] = [
      // DNS (6)
      dnsLookupTool,
      dnsReverseTool,
      dnsEmailSecurityTool,
      dnsSpfChainTool,
      dnsSrvDiscoverTool,
      dnsWildcardCheckTool,
  • Import of the dnsLookup function from src/dns/index.js into the tools registry module.
    import { dnsLookup, dnsReverse, dnsEmailSecurity, dnsSpfChain, dnsSrvDiscover, dnsWildcardCheck } from "../dns/index.js";
  • src/index.ts:24-26 (registration)
    CLI category listing that includes 'dns_lookup' in the DNS tool group (no API key required). Also referenced in example usage on line 53.
    label: "DNS",
    env: null,
    tools: ["dns_lookup", "dns_reverse", "dns_email_security", "dns_spf_chain", "dns_srv_discover", "dns_wildcard_check"],
Behavior2/5

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

No annotations are provided, and the description fails to disclose behavioral traits such as error handling, rate limits, or authentication requirements. It only restates the supported record types.

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 very concise and front-loaded, using two sentences to convey the core functionality with no wasted words.

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?

For a simple two-parameter tool, the description covers the basic purpose and supported record types, but lacks information about return values or behavior on errors, which could be helpful given the absence of an output schema.

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 coverage is 100% for both parameters, and the description does not add new meaning beyond what the schema provides, merely listing the enum values again.

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

Purpose5/5

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

The description clearly states the tool resolves DNS records and lists all supported record types. It distinguishes itself from sibling tools like dns_reverse and dns_spf_chain.

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

Usage Guidelines3/5

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

The description implies usage through its name and function, but lacks explicit guidance on when to use this tool versus alternatives like dns_reverse or dns_spf_chain.

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