DNS Lookup

Resolve DNS records for any hostname. Returns A, AAAA, CNAME, MX, TXT, and NS records. Optionally filter to a specific record type.

GET /api/dns-lookup

Try it

{
  "ok": true,
  "hostname": "example.com",
  "normalizedHostname": "example.com",
  "records": {
    "A": ["93.184.216.34"],
    "AAAA": [],
    "CNAME": [],
    "MX": [],
    "TXT": [],
    "NS": ["a.iana-servers.net", "b.iana-servers.net"]
  },
  "meta": {
    "lookupTimeMs": 42,
    "cached": false,
    "rateLimitedScope": "global"
  }
}

What it returns

Use cases

Quick API examples

curl (all record types)

curl "https://tinyutils.dev/api/dns-lookup?domain=example.com"

curl (MX records only)

curl "https://tinyutils.dev/api/dns-lookup?domain=example.com&type=MX"

JavaScript (fetch)

const res = await fetch(
  "https://tinyutils.dev/api/dns-lookup?domain=example.com"
);
const data = await res.json();
console.log(data.records.A, data.records.MX);

Batch endpoint

Look up to 10 domains in a single request using POST /api/dns-lookup/batch.

curl -X POST "https://tinyutils.dev/api/dns-lookup/batch" \
  -H "Content-Type: application/json" \
  -d '{"domains":["example.com","openai.com"]}'