DNS Lookup

/api/dnslookup 1 credit(s) per call

Look up DNS records for any domain name including A, AAAA, MX, NS, TXT, and CAA records.

Overview

The DNS Lookup API queries all DNS record types for a domain name and returns A, AAAA, MX, NS, TXT, CNAME, SOA, SRV, and CAA records with query timing. All record types are queried automatically and only non-empty record types are included in the response.

Endpoint

POST /api/dnslookup
GET /api/dnslookup/lookup?domain=example.com

Request Parameters

Parameter Type Required Description
domain string Yes The domain name to look up (e.g. example.com)

Response Fields

The response is wrapped in a standard API envelope:

Field Type Description
success boolean true on success
data.domain string The queried domain name
data.aRecords array IPv4 addresses
data.aaaaRecords array IPv6 addresses
data.mxRecords array Mail exchange records, each with host and preference
data.nsRecords array Name server hostnames
data.txtRecords array Text records (e.g. SPF, DKIM)
data.cnameRecords array Canonical name aliases
data.soaRecord object Start of Authority record with primaryNameServer, responsiblePerson, serial, refresh, retry, expire, minimumTimeToLive
data.srvRecords array Service records, each with host, port, priority, weight
data.caaRecords array Certification Authority Authorization records, each with flags, tag, value
data.queryTimeMs int Total query time in milliseconds

Example

Look up DNS records for a domain:

curl -X POST https://simplewebapis.com/api/dnslookup \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: swa_your_key" \
  -d '{"domain": "example.com"}'

The response is a JSON object (Content-Type: application/json).

Try it out

Use the Playground to test this API live.