DNS Lookup API

The DNS Lookup API retrieves DNS records for any given domain.

(4.5)

From 2,972 users

500+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
254ms292ms350ms663ms1109ms

Didn't find what you were looking for? Suggest an improvement


/v1/dnslookup GET

https://api.api-ninjas.com/v1/dnslookup

Returns a list of DNS records associated with a particular domain.

Parameters

  • domain  required

    Valid domain to check (e.g. example.com). For top-level domains other than .com, a premium subscription is required.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

Returns an array of DNS record objects. Each record contains:

  • record_type

    Type of DNS record. Supported types:

  • value

    The value of the DNS record.

  • priority

    Priority value (for MX records).

  • mname, rname, serial, refresh, retry, expire, ttl

    Additional fields for SOA records only.

Sample Request Live Demo!

domain

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/dnslookup?domain=example.com

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/dnslookup?domain=example.com" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.