api-ninjas-com DNS Lookup API

The DNS Lookup API retrieves DNS records for any given domain. Currently supports A, AAAA, CNAME, MX, NS, PTR, SRV, SOA, TXT, and CAA record types.

Operations 1

GET /v1/dnslookup Retrieve DNS records for a domain #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-dns-lookup-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-dns-lookup-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas DNS Lookup API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: DNS Lookup
  description: The DNS Lookup API retrieves DNS records for any given domain. Currently supports A, AAAA, CNAME, MX, NS, PTR, SRV, SOA, TXT, and CAA record types.
paths:
  /v1/dnslookup:
    get:
      summary: Retrieve DNS records for a domain
      description: Retrieves DNS records for a domain, covering the A, AAAA, CNAME, MX, NS, PTR, SRV, SOA, TXT and CAA record types. Requires `domain`.
      operationId: getDNSRecords
      security:
      - ApiKeyAuth: []
      parameters:
      - name: domain
        in: query
        description: Valid domain to check (e.g. example.com). For top-level domains other than .com, a premium subscription is required.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A list of DNS records for the specified domain.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DNSRecord'
        '400':
          description: Bad Request - The request was invalid or cannot be served.
        '401':
          description: Unauthorized - The request requires user authentication.
        '500':
          description: Internal Server Error - We had a problem with our server. Try again later.
      tags:
      - DNS Lookup
components:
  schemas:
    DNSRecord:
      type: object
      properties:
        record_type:
          type: string
          description: The type of DNS record.
        value:
          type: string
          description: The value of the DNS record.
        priority:
          type: integer
          description: The priority of the MX record. Only present for MX records.
        mname:
          type: string
          description: The MNAME of the SOA record. Only present for SOA records.
        rname:
          type: string
          description: The RNAME of the SOA record. Only present for SOA records.
        serial:
          type: integer
          description: The SERIAL of the SOA record. Only present for SOA records.
        refresh:
          type: integer
          description: The REFRESH of the SOA record. Only present for SOA records.
        retry:
          type: integer
          description: The RETRY of the SOA record. Only present for SOA records.
        expire:
          type: integer
          description: The EXPIRE of the SOA record. Only present for SOA records.
        ttl:
          type: integer
          description: The TTL of the SOA record. Only present for SOA records.
      required:
      - record_type
      - value
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api