agentsvc.io

services / dns-lookup

utilityoperational · 2 ms

DNS Lookup

Resolve DNS records for any domain. Supports A, AAAA, MX, TXT, CNAME, NS. Returns records object with array per type. Default: A records only. Use to verify mail server setup (MX), check domain ownership (TXT), or debug DNS propagation.

Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/dns-lookup", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"domain":"github.com","types":["A","MX"]}),
});
const { data, payment } = await res.json();  // payment.transaction = on-chain receipt

Input

FieldTypeDescription
domain *stringDomain name to look up (e.g. 'example.com', 'mail.google.com')
typesarray = ["A"]DNS record types to resolve. Default: ["A"]. Supported: A, AAAA, MX, TXT, CNAME, NS

Output

FieldTypeDescription
domainstringThe queried domain name
recordsobjectMap of DNS record type → array of records
resolved_atstringISO 8601 timestamp of the lookup

Example response (data)

{
  "domain": "example.com",
  "records": {
    "A": [
      "93.184.216.34"
    ],
    "MX": [
      {
        "priority": 10,
        "exchange": "mail.example.com"
      }
    ]
  },
  "resolved_at": "2026-04-07T12:00:00.000Z"
}