apyhub
DEVELOPER TOOLS · STANDARD DATA

Batch DNS Lookups

What it does

Batch DNS Lookups lets you resolve up to 25 hosts in one request and get DNS answers back in a single response. Send a queries array with each item containing a host and an optional type of A, AAAA, MX, NS, TXT, CNAME, or PTR.

Each result includes the queried host, the record type, and a status of OK, NXDOMAIN, NODATA, or ERROR. Depending on the record type, the response may also include addresses for A and AAAA, mx records with preference and exchange, names for NS or CNAME, txt strings, or ptr targets. When a row fails, error is returned for that row.

Use Batch DNS Lookups when you need to verify domains, inspect mail routing, or check reverse DNS at scale. It fits domain onboarding flows, infrastructure audits, and bulk asset checks where you want to reduce resolver round trips and keep DNS results aligned by input row.

POST
Batch DNS lookups (max 25)
https://api.eu.apyverse.com/apyhub/batch-dns-lookups

QUICKSTART

GUIDE

Quickstart

Look up one or more DNS record types in a single batch request.

curl -X POST "https://api.eu.apyverse.com/apyhub/batch-dns-lookups" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": [
      {
        "host": "google.com",
        "type": "A"
      }
    ]
  }'

What you'll get back

Returns a JSON object with a data object. Inside data, results is an array of DNS lookup results; each item includes status, host, and type, plus record-specific fields such as addresses, mx, names, txt, or ptr when applicable.

{
  "data": {
    "results": [
      {
        "status": "OK",
        "host": "google.com",
        "type": "A",
        "addresses": ["142.250.185.78"]
      }
    ]
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
queries*

About this endpoint

What it does

Performs up to 25 DNS lookups in a single request. You send a list of query objects with a required host and an optional record type, and the response returns a results array with one DNS answer object per query.

Request Body

ParameterTypeMandatoryDescription
queriesObject ArrayYesArray of DNS queries to resolve. Max 25 items.
queries[].hostStringYesDomain, FQDN, or IP address for PTR lookups.
queries[].typeENUMNoRecord type to query. Allowed values: A, AAAA, MX, NS, TXT, CNAME, PTR. Default: A. Omit for A.

Response

Returns a JSON object with a data object that contains a results array. Each item in results is a DNS answer object with status, host, and type fields, plus record-specific fields such as addresses, names, mx, ptr, txt, or error depending on the query and result.

ParameterTypeMandatoryDescription
dataObjectNoWrapper object containing the response payload.
data.resultsObject ArrayNoDNS answer objects, one per submitted query.
data.results[].hostStringYesQueried host, or IP address when the query type is PTR.
data.results[].typeENUMYesRecord type that was queried. Allowed values: A, AAAA, MX, NS, TXT, CNAME, PTR.
data.results[].statusENUMYesResult status. Allowed values: OK, NXDOMAIN, NODATA, ERROR.
data.results[].addressesString ArrayNoIPv4 (A) or IPv6 (AAAA) addresses.
data.results[].namesString ArrayNoHostnames returned for NS or CNAME queries.
data.results[].mxObject ArrayNoMX resource records. Each item includes preference and exchange.
data.results[].mx[].preferenceIntegerYesMX preference; lower values indicate higher priority.
data.results[].mx[].exchangeStringYesMail exchanger hostname, often with a trailing dot.
data.results[].ptrString ArrayNoPTR target names returned for reverse DNS lookups.
data.results[].txtString ArrayNoTXT RDATA strings, one element per TXT record.
data.results[].errorStringNoPresent when status is ERROR; contains the resolver or validation error for that row.

Notes

The request body queries array is limited to 25 items. Only the fields relevant to the queried record type are populated in each result item; other record-specific fields are omitted.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.