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
- •ok - whether the lookup succeeded
- •hostname - the input hostname
- •normalizedHostname - the cleaned, lowercase hostname
- •records - DNS records grouped by type (A, AAAA, CNAME, MX, TXT, NS)
- •meta.lookupTimeMs - time taken for the DNS resolution
- •meta.cached - whether the result came from cache
Use cases
- •Verify MX records when debugging email delivery issues
- •Check if a domain has a CNAME pointing to the right place
- •Confirm DNS propagation after changing nameservers
- •Validate that a new domain has A records set up
- •Automate domain health checks in your CI pipeline
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"]}'