DNS Lookup
Look up DNS records of any type for a domain.
GET
/v1/lookup
curl "https://dns.toolkitapi.io/v1/lookup?domain=toolkitapi.io&type=MX"
import httpx
resp = httpx.get(
"https://dns.toolkitapi.io/v1/lookup?domain=toolkitapi.io&type=MX",
)
print(resp.json())
const resp = await fetch("https://dns.toolkitapi.io/v1/lookup?domain=toolkitapi.io&type=MX", {
});
const data = await resp.json();
console.log(data);
# See curl example
Response
200 OK
{
"status": "ok",
"data": {
"domain": "toolkitapi.io",
"record_type": "MX",
"records": [
{"priority": 10, "value": "mail.toolkitapi.io", "ttl": 3600}
],
"query_time_ms": 15
}
}
Try It Live
Live Demo
Response
Description
Look up DNS records of any type for a domain.
How to Use
1
1. Pass the target domain in the `domain` parameter.
2
2. Set the `type` parameter to the DNS record type you want (A, AAAA, CNAME, MX, NS, TXT, SOA, CAA, PTR, SRV). Defaults to `A`.
3
3. Parse the `data.records` array in the response to get each record's value and TTL.
About This Tool
DNS Lookup queries the system's default resolver for any DNS record type and returns all matching records with their TTL values and query timing.
It's the API equivalent of running `dig` or `nslookup` but with structured JSON output and support for every common record type including SRV.
Why Use This Tool
- Mail server discovery — Look up MX records to find a domain's mail servers
- TXT record verification — Retrieve SPF, DKIM, or domain-verification TXT records
- Nameserver auditing — Check NS records to verify delegations are correct
- Infrastructure mapping — Resolve CNAME chains and A/AAAA records for load balancer endpoints
Frequently Asked Questions
What's the difference between Lookup and Propagation?
Lookup uses a single resolver and returns the authoritative answer. Propagation queries 20+ resolvers worldwide and compares whether they all agree. Use Lookup for quick record checks; use Propagation after making DNS changes.
Does this resolve CNAME chains?
The lookup returns the immediate CNAME target. If you need a fully resolved chain, call the endpoint repeatedly following each CNAME until you reach an A or AAAA record.
Can I look up SRV records?
Yes. Set `type=SRV` and provide the full service name including the underscore prefix (e.g. `_sip._tcp.toolkitapi.io`).
Start using DNS Lookup now
Get your free API key and make your first request in under a minute.