DNS Lookup API - resolve DNS records over HTTP

Need to resolve DNS records from your application, a script, or a CI job - without installing anything or managing DNS libraries? Use the TinyUtils DNS Lookup API.

The problem

Running DNS lookups programmatically requires either a DNS library specific to your language, raw UDP socket access, or a DoH (DNS over HTTPS) provider with a custom query format. Most of these return raw DNS wire format or require parsing complex responses.

The TinyUtils DNS API returns clean JSON with all record types grouped and parsed - ready to use in your code.

Quick solution

Send a GET request to /api/dns-lookup with any domain. You get back all DNS record types in a single response.

curl

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

Response

{
  "ok": true,
  "hostname": "example.com",
  "normalizedHostname": "example.com",
  "records": {
    "A": ["93.184.216.34"],
    "AAAA": ["2606:2800:21f:cb07:6820:80da:af6b:8b2c"],
    "CNAME": [],
    "MX": [],
    "TXT": ["v=spf1 -all"],
    "NS": ["a.iana-servers.net", "b.iana-servers.net"]
  },
  "meta": {
    "lookupTimeMs": 42,
    "cached": false,
    "rateLimitedScope": "global"
  }
}

JavaScript (fetch)

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

if (data.ok) {
  console.log("A records:", data.records.A);
  console.log("MX records:", data.records.MX);
}

Filter by record type

Add a type parameter to get only the record type you need.

curl (MX only)

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

Use cases

Batch lookups

Look up to 10 domains in a single request using the batch endpoint.

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

Try the DNS Lookup tool

Enter any domain and see its DNS records instantly.

Open DNS Lookup →