DNS Lookup1 Credit
Query DNS records including A, AAAA, CNAME, MX, NS, TXT and more for comprehensive domain analysis.
The DNS API looks up any record type for a domain name or IP address, or ALL for the common ones. By default it asks the domain's authoritative nameservers itself, resolving from the root, so the answer comes from the source and not from a resolver's cache. Set server to ask a public resolver or any server you choose. Queries go over UDP, and an answer too large for UDP is asked again over TCP; transport=tcp asks everything over TCP. dnssec=true adds the DNSSEC records, and subdomains=true probes the full lists of well-known subdomains. verbose=true adds each query's response code, flags, sections and the trace of servers it asked.
Each call costs 1 credit. Results are cached for up to 10 minutes.
See Authentication for details.
X-API-Key<token>Provide your API key in an HTTP request header.
name*stringThe domain name to look up, or an IP address
1 <= lengthverbose?booleanReturn extra detail: totalElapsed, retries and params, plus each errors entry's detail when the lookup fails. For DNS, also returns answers, one entry for each name and record type queried. Each has its response code, flags, authority and additional sections, and trace, the servers queried to reach the answer.
falsetype?stringThe type of DNS record to query, or ALL for all common record types.
"ALL""ALL""REVERSE""SPF""SOA""NS""A""AAAA""CNAME""DNAME""MX""TXT""CAA""TLSA""DS""DNSKEY""RRSIG""NSEC""NSEC3""NSEC3PARAM""CDS""CDNSKEY""KEY""SIG""SRV""HTTPS""SVCB""CERT""HINFO""TSIG""OPENPGPKEY""RP""SSHFP""URI""NAPTR""LOC""PTR"server?stringDNS server to use for queries, or authoritative for authoritative server queries.
recursive?booleanEnable recursive resolution. Some public servers require or ignore this. Authoritative queries always have server-based recursion disabled as we do the resolution ourselves.
truednssec?booleanEnable DNSSEC validation and return additional DNSSEC records. Some nameservers do not support this and will return errors.
falsesubdomains?booleanProbe the full lists of well-known subdomains (www, mail, _dmarc and many more) alongside the domain itself. By default only a handful of the most common names are probed, which is considerably faster. Applies to ALL, A, AAAA, CNAME and TXT queries for a base domain — other record types, and queries for a subdomain, are unaffected.
falsetransport?stringThe DNS transport protocol to use. UDP is faster, and an answer too large for it is asked again over TCP. TCP asks everything over TCP.
"udp""udp""tcp"Successful dns response
application/json- response
tool*stringTool that generated this result
"dns""domain""reverse""site""dnssec""ssl""email""redirect"query*stringThe original FQDN/qname that was queried
requestId*|Unique request identifier that generated this result
timestamp*stringUTC timestamp when the result was generated
elapsed*|Time taken to generate the result in milliseconds
cached*booleanWhether this result was served from cache
totalElapsed?|Returned with verbose. Total time in milliseconds, including retries and any lookups this one made. For a cached result, the time to read it
retries?numberReturned with verbose. Number of retries before the answer, 0 for a cached result
params?Returned with verbose. The query parameters you set that differ from their defaults
results*array<||||||||||||||||||||||||||||||||>|Every record found, each once, in canonical order (name, type, priority, content, TTL). Each record has its name, type, class and ttl, then the fields of its type under their RFC names in camelCase: preference and exchange for MX, strings for TXT, keyTag for DS.
queryType*stringThe original query type
"ALL""REVERSE""SPF""SOA""NS""A""AAAA""CNAME""DNAME""MX""TXT""CAA""TLSA""DS""DNSKEY""RRSIG""NSEC""NSEC3""NSEC3PARAM""CDS""CDNSKEY""KEY""SIG""SRV""HTTPS""SVCB""CERT""HINFO""TSIG""OPENPGPKEY""RP""SSHFP""URI""NAPTR""LOC""PTR"server*stringThe address of the server that gave most of the answers, and serverName its name.
serverName?stringThe name of the server that provided the answers
serverType*stringThe requested server type
"custom""authoritative""public""privacy""safety""isp""root""reverse"transport*stringThe transport protocol used
"udp""tcp"recursive*booleanWhether recursive resolution was requested
dnssec*booleanWhether DNSSEC was requested
subdomains*booleanWhether subdomains were probed
status?stringWhat the answers for the name and type asked amount to. For ALL: nxdomain if any says so, else ok if any has records, else alias, else nodata, else failed. A name that does not exist is a 200 with nxdomain, whatever the server type
"ok""nxdomain""nodata""referral""alias""failed"answers?array<>With verbose=true: one entry for each name and record type asked, with its rcode, status, header flags, the three sections and the trace of every server asked from the root.
errors*array<>Empty on a clean answer. On a 200, one entry for each question of the lookup that failed. On any other status, why the request failed. The HTTP status is in the response line only
See Errors for the response format.
invalid_requestinvalid_queryblocked_addressauthentication_failedinvalid_api_keyapi_key_expiredout_of_creditsforbiddenserver_not_foundrate_limitedinternal_errorupstream_timeoutupstream_unreachableupstream_invalidcurl -X GET 'https://api.dns.tools/v1/dns?name=google.com'{ "tool": "dns", "query": "google.com", "queryType": "ALL", "server": "216.239.36.10", "serverName": "ns3.google.com", "serverType": "authoritative", "transport": "udp", "recursive": false, "dnssec": false, "subdomains": true, "status": "ok", "requestId": "43fdb9c6-f438-4b20-a2f5-84c319fbcc57", "timestamp": "2026-11-26T00:26:37.608Z", "elapsed": 235, "cached": false, "errors": [], "results": [ { "name": "google.com", "type": "SOA", "class": "IN", "ttl": 60, "mname": "ns1.google.com", "rname": "dns-admin.google.com", "serial": 1028908002, "refresh": 900, "retry": 900, "expire": 1800, "minimum": 60 }, { "name": "google.com", "type": "NS", "class": "IN", "ttl": 345600, "target": "ns1.google.com" }, { "name": "google.com", "type": "NS", "class": "IN", "ttl": 345600, "target": "ns2.google.com" }, { "name": "google.com", "type": "NS", "class": "IN", "ttl": 345600, "target": "ns3.google.com" }, { "name": "google.com", "type": "NS", "class": "IN", "ttl": 345600, "target": "ns4.google.com" }, { "name": "google.com", "type": "A", "class": "IN", "ttl": 300, "address": "142.251.210.46" }, { "name": "google.com", "type": "AAAA", "class": "IN", "ttl": 300, "address": "2607:f8b0:4006:811::200e" }, { "name": "google.com", "type": "MX", "class": "IN", "ttl": 300, "preference": 10, "exchange": "smtp.google.com" }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "_r4rd1pvwyrpi7sw4a3hzmw8e51yh9td" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "apple-domain-verification=30afIBcvSuDV2PLX" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "arcules-domain-verification=2R4t5G7nI6tRCo61lpxxbLksPYstxhGmtV75cpr8x9K" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "cisco-ci-domain-verification=47c38bc8c4b74b7233e9053220c1bbe76bcc1cd33c7acf7acd36cd6a5332004b" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "docusign=1b0a6754-49b1-4db5-8540-d2c12664b289" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "docusign=05958488-4752-4ef2-95eb-aa7ba8a3bd0e" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "facebook-domain-verification=22rm551cu4k0ab0bxsw536tlds4h95" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "globalsign-smime-dv=CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8=" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "google-site-verification=4ibFUgB-wXLQ_S7vsXVomSTVamuOXBiVAzpR5IZ87D0" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "google-site-verification=TV9-DBe4R80X4v0M4U_bd_J9cpOJM0nikft0jAgjmsQ" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "google-site-verification=wD8N7i1JTNTkezJ49swvWW48f8_9xveREV4oB-0Hf5o" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "MS=E4A68B9AB2BB9670BCE15412F62916164C0B20BB" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "onetrust-domain-verification=0d477fe608074e6f9c12bca7826035cc" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "onetrust-domain-verification=6d685f1d41a94696ad7ef771f68993e0" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "v=spf1 include:_spf.google.com ~all" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "work-accounts-domain-verification=Tcj6JjIMZOw2KsSEw2Nt2rLae89tN6" ] }, { "name": "google.com", "type": "TXT", "class": "IN", "ttl": 300, "strings": [ "Z29vZ2xl" ] } ]}