senapati
Documentation index

DNS Lookup

A plain resolver behind the same API key: ask for one record type or pass ALL to get every common type in a single call. Handy for verifying MX and SPF before mailing, or for pulling the A record you are about to run through IP reputation.

POST/api/dns-lookupCosts 1 creditAPI key

DNS record lookup

Record types

record_typeReturns
A · AAAAIPv4 / IPv6 addresses
MXMail exchangers with priority
NSAuthoritative name servers
TXTText records (SPF, DKIM, DMARC, verification tokens)
CNAMECanonical name
SOAStart of authority (serial, refresh, retry, expire, TTL)
ALLEvery type above in one call (default)

Request

JSON body
FieldTypeDescription
domain*stringDomain name to query
record_typestringRecord type(s) or ALLdefault "ALL"

Authenticate with API key. Send it as the X-API-Key header.

curl -X POST "https://api.senapati.io/api/dns-lookup" \
  -H "X-API-Key: $SENAPATI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain":"example.com","record_type":"A"}'

Response

Every success is wrapped in { "data": … } with a request_id; the fields below describe data. See Errors for the failure shape.

response: 200 OKDNSLookupData
{
"request_id": "req_8f2c1a7e",
"timestamp": "2026-08-27T12:00:31.948809+00:00",
"data": {
"domain": "example.com",
"records": {},
"elapsed_ms": 10078
}
}
data · DNSLookupData
FieldTypeDescription
domain*string
recordsobject
elapsed_msintegerdefault 0

Errors

  • 401missing or invalid API key / token
  • 402not enough credits on the account
  • 422the request body or a parameter failed validation
  • 429plan rate limit exceeded

Notes

records is keyed by lower-cased type; a type with no answer is simply absent. A domain that does not resolve at all returns an empty records object, not an error.

  • One credit per call whichever type you ask for, so ALL is the best value.