Docs/APIs/DNS Lookup

DNS Lookup

Lookup domain DNS records

OperationalCredits 6 per callp50 215msDomain DataStar

Overview

A DNS lookup API for checking a domain's records from code, the nslookup or dig step in onboarding, email and migration checks. Send a domain or hostname and DNS Lookup queries its records live and returns them as JSON, with flags for IPv6, mail servers and SPF. Every plan gets A, AAAA and MX records with priorities; paid plans add CNAME, NS, SOA and TXT records.

Live Test DNS Lookup API →

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

GEThttps://api.apiverve.com/v1/dnslookup
curl "https://api.apiverve.com/v1/dnslookup?domain=myspace.com&type=A%2CMX%2CTXT" \
  -H "x-api-key: your_api_key_here"

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
domainRequiredstringThe domain or DNS name to look up, without the protocol. Underscore names work too, such as _dmarc.example.com or _sip._tcp.example.com
length 0–253
typeOptionalstringComma-separated record types to look up. Leave it out for A, AAAA, CNAME, MX, NS, PTR, SRV, SOA, TXT and CAA. HTTPS, SVCB, TLSA, NAPTR, DS and DNSKEY are returned only when named here
AAAAACNAMEMXNSPTRSRVSOA+8

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "domain": "google.com",
    "records": {
      "A": [
        "172.253.156.100",
        "172.253.156.113",
        "172.253.156.101",
        "172.253.156.139",
        "172.253.156.138",
        "172.253.156.102"
      ],
      "AAAA": [
        "2607:f8b0:4023:100d::65",
        "2607:f8b0:4023:100d::8a",
        "2607:f8b0:4023:100d::71",
        "2607:f8b0:4023:100d::64"
      ],
      "CNAME": null,
      "MX": [
        {
          "exchange": "smtp.google.com",
          "priority": 10
        }
      ],
      "NS": [
        "ns4.google.com",
        "ns3.google.com",
        "ns2.google.com",
        "ns1.google.com"
      ],
      "PTR": null,
      "SRV": null,
      "SOA": {
        "nsname": "ns1.google.com",
        "hostmaster": "dns-admin.google.com",
        "serial": 1005474929,
        "refresh": 900,
        "retry": 900,
        "expire": 1800,
        "minttl": 60
      },
      "TXT": [
        [
          "onetrust-domain-verification=0d477fe608074e6f9c12bca7826035cc"
        ],
        [
          "work-accounts-domain-verification=Tcj6JjIMZOw2KsSEw2Nt2rLae89tN6"
        ],
        [
          "google-site-verification=wD8N7i1JTNTkezJ49swvWW48f8_9xveREV4oB-0Hf5o"
        ],
        [
          "Z29vZ2xl"
        ],
        [
          "globalsign-smime-dv=CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8="
        ],
        [
          "arcules-domain-verification=2R4t5G7nI6tRCo61lpxxbLksPYstxhGmtV75cpr8x9K"
        ],
        [
          "v=spf1 include:_spf.google.com ~all"
        ],
        [
          "_r4rd1pvwyrpi7sw4a3hzmw8e51yh9td"
        ],
        [
          "apple-domain-verification=30afIBcvSuDV2PLX"
        ],
        [
          "onetrust-domain-verification=6d685f1d41a94696ad7ef771f68993e0"
        ],
        [
          "facebook-domain-verification=22rm551cu4k0ab0bxsw536tlds4h95"
        ],
        [
          "google-site-verification=TV9-DBe4R80X4v0M4U_bd_J9cpOJM0nikft0jAgjmsQ"
        ],
        [
          "MS=E4A68B9AB2BB9670BCE15412F62916164C0B20BB"
        ],
        [
          "docusign=05958488-4752-4ef2-95eb-aa7ba8a3bd0e"
        ],
        [
          "google-site-verification=4ibFUgB-wXLQ_S7vsXVomSTVamuOXBiVAzpR5IZ87D0"
        ],
        [
          "docusign=1b0a6754-49b1-4db5-8540-d2c12664b289"
        ],
        [
          "cisco-ci-domain-verification=47c38bc8c4b74b7233e9053220c1bbe76bcc1cd33c7acf7acd36cd6a5332004b"
        ]
      ],
      "CAA": [
        {
          "critical": 0,
          "issue": "pki.goog"
        }
      ]
    },
    "ttl": {
      "A": 10,
      "AAAA": 2,
      "CNAME": null,
      "MX": 74,
      "NS": 15382,
      "PTR": null,
      "SRV": null,
      "SOA": 25,
      "TXT": 300,
      "CAA": 21600
    },
    "summary": {
      "hasIPv6": true,
      "hasMailServers": true,
      "hasSPF": true
    }
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
domainstring"google.com"The domain name that was queried
recordsobject{...}Object containing all DNS records for the domain
Aarray[172.253.156.100, ...]IPv4 address records for the domain
AAAAarray[2607:f8b0:4023:100d::65, ...]IPv6 address records for the domain
CNAMEPremiumobjectnullCanonical name alias records
MXarray[1]Mail exchange server records with priority
exchangestring"smtp.google.com"Mail server hostname
prioritynumber10Priority level for the mail server
NSPremiumarray[ns4.google.com, ...]Nameserver records for the domain
PTRobjectnullPointer records published at this name
SRVobjectnullService records, published at names such as _sip._tcp.example.com
SOAPremiumobject{...}Start of Authority record with DNS zone info
nsnamePremiumstring"ns1.google.com"Primary nameserver hostname
hostmasterPremiumstring"dns-admin.google.com"Email address of domain administrator
serialPremiumnumber1005474929Serial number for zone version tracking
refreshPremiumnumber900Secondary server refresh interval in seconds
retryPremiumnumber900Retry interval for failed transfers
expirePremiumnumber1800Zone expiration time in seconds
minttlPremiumnumber60Minimum time to live for records
TXTPremiumarrayArray of arraysText records including SPF, DKIM, verification data
CAAarray[1]Certificate Authority Authorization records: which CAs may issue certificates. Each entry has critical plus its tag (issue, issuewild or iodef) as the key
criticalnumber0
issuestring"pki.goog"
ttlPremiumobject{...}Seconds each record type stays cached, keyed by type (lowest in the set), as a public resolver serves it: it counts down from the zone's configured TTL while cached. null for a type with no records
APremiumnumber10
AAAAPremiumnumber2
CNAMEPremiumobjectnull
MXPremiumnumber74
NSPremiumnumber15382
PTRPremiumobjectnull
SRVPremiumobjectnull
SOAPremiumnumber25
TXTPremiumnumber300
CAAPremiumnumber21600
summaryobject{...}At-a-glance flags derived from the records above
hasIPv6booleantrueWhether the domain publishes any AAAA (IPv6) records — indicates dual-stack readiness
hasMailServersbooleantrueWhether the domain publishes any MX records — indicates it is configured to receive email
hasSPFPremiumbooleantrueWhether a TXT record starting with v=spf1 is present — a coarse email-authentication posture flag (use the SPF Validator to parse it)

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Start from a template

A working app built on this API, ready to deploy with your own key. Vercel asks for the key when you deploy; the code is on GitHub to change first.

Use cases

Mail Delivery Verification
To verify email destination readiness, onboarding systems query incoming domain MX records and priority values before routing outbound messages.
Dual-Stack Infrastructure Auditing
DevOps engineers inspect IPv4 and IPv6 addresses across client domains to confirm dual-stack network reachability and detect missing AAAA entries.
Domain Migration Monitoring
When moving web infrastructure to new hosts, deployment pipelines check resolving A and MX records in real time to verify DNS propagation.
Custom Domain Onboarding
Hosting platforms query target domains during customer onboarding to verify that resolved IP addresses point to designated web servers.

Other ways to use DNS Lookup

Set up DNS Lookup on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKit →Reference →
Google Sheets or ExcelA =VERVE() formula fills a column — no script, no export, recalculates in place.VerveSheets →Reference →
Ground an agent on itA cited, machine-checkable fact your model can't produce on its own.VerveContext →Reference →

More in Domain Data:

Was this page helpful?