IP-API.io DNS Lookup API

DNS record lookup tools

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 4

GET /api/v1/dns/whois/{domain} WHOIS lookup for a domain #
GET /api/v1/dns/reverse/{ip} Reverse DNS lookup for an IP address #
GET /api/v1/dns/mx/{domain} Look up MX records for a domain #
GET /api/v1/dns/forward/{hostname} Forward DNS lookup for a hostname #

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/ip-api-io:ip-api-io-dns-lookup-api-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

ip-api-io-dns-lookup-api-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: IP-API.io - IP Geolocation & Security DNS Lookup API
  description: 'Comprehensive IP address intelligence API providing geolocation, security analysis, and network information.


    Features:

    - Real-time IP geolocation with city-level accuracy

    - Advanced threat detection and security scoring

    - VPN, proxy, and Tor node detection

    - Email validation and reputation analysis

    - Email / ip risk scoring for fraud prevention


    Perfect for fraud prevention, security applications, content personalization, and compliance requirements.'
  contact:
    name: IP-API.io Support
    url: https://ip-api.io
    email: support@ip-api.io
  license:
    name: Commercial License
    url: https://ip-api.io
  version: 1.0.0
servers:
- url: https://ip-api.io
  description: Production server
security:
- ApiKeyAuth: []
tags:
- name: DNS Lookup API
  description: DNS record lookup tools
paths:
  /api/v1/dns/whois/{domain}:
    get:
      tags:
      - DNS Lookup API
      summary: WHOIS lookup for a domain
      description: Returns structured WHOIS data including registrar, registration dates, nameservers, and EPP status codes. Results are cached for 24 hours.
      operationId: getWhois
      parameters:
      - name: domain
        in: path
        description: Domain name, e.g. example.com
        required: true
        schema:
          type: string
        example: example.com
      responses:
        '200':
          description: WHOIS data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoisResponse'
        '400':
          description: Invalid domain name format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoisResponse'
        '404':
          description: Domain not found or not registered
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoisResponse'
        '502':
          description: WHOIS lookup failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoisResponse'
  /api/v1/dns/reverse/{ip}:
    get:
      tags:
      - DNS Lookup API
      summary: Reverse DNS lookup for an IP address
      description: Returns the PTR record (hostname) for a given IPv4 or IPv6 address. Results are cached for 5 minutes.
      operationId: getReverseDns
      parameters:
      - name: ip
        in: path
        description: IPv4 or IPv6 address
        required: true
        schema:
          type: string
        example: 8.8.8.8
      responses:
        '200':
          description: Reverse DNS lookup completed (hostname may be null if no PTR record exists)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReverseDnsResponse'
        '400':
          description: Invalid IP address format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReverseDnsResponse'
        '502':
          description: DNS lookup failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReverseDnsResponse'
  /api/v1/dns/mx/{domain}:
    get:
      tags:
      - DNS Lookup API
      summary: Look up MX records for a domain
      description: Returns all MX records for a domain, sorted by priority ascending. Results are cached for 5 minutes.
      operationId: getMxRecords
      parameters:
      - name: domain
        in: path
        description: Domain name, e.g. gmail.com
        required: true
        schema:
          type: string
        example: gmail.com
      responses:
        '200':
          description: MX records retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MxLookupResponse'
        '400':
          description: Invalid domain name format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MxLookupResponse'
        '404':
          description: Domain not found (NXDOMAIN)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MxLookupResponse'
        '502':
          description: DNS lookup failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MxLookupResponse'
  /api/v1/dns/forward/{hostname}:
    get:
      tags:
      - DNS Lookup API
      summary: Forward DNS lookup for a hostname
      description: Returns A and AAAA records for a given hostname. Results are cached for 5 minutes.
      operationId: getForwardDns
      parameters:
      - name: hostname
        in: path
        description: Hostname to look up, e.g. dns.google
        required: true
        schema:
          type: string
        example: dns.google
      responses:
        '200':
          description: Forward DNS lookup succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardDnsResponse'
        '400':
          description: Invalid hostname format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardDnsResponse'
        '404':
          description: No address records found for the hostname
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardDnsResponse'
        '502':
          description: DNS lookup failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardDnsResponse'
components:
  schemas:
    WhoisStatus:
      type: object
      properties:
        code:
          type: string
        humanized:
          type: string
      required:
      - code
      - humanized
    MxLookupResponse:
      type: object
      properties:
        domain:
          type: string
        mx_records:
          type: array
          items:
            $ref: '#/components/schemas/MxRecord'
      required:
      - domain
      - mx_records
    MxRecord:
      type: object
      properties:
        priority:
          type: integer
          format: int32
        hostname:
          type: string
        ttl:
          type: integer
          format: int64
      required:
      - hostname
      - priority
      - ttl
    ReverseDnsResponse:
      type: object
      properties:
        ip:
          type: string
        hostname:
          type:
          - string
          - 'null'
        ptr_record:
          type: string
        ttl:
          type:
          - integer
          - 'null'
          format: int64
      required:
      - ip
    ForwardLookupRecord:
      type: object
      properties:
        type:
          type: string
        address:
          type: string
        ttl:
          type: integer
          format: int64
      required:
      - address
      - ttl
      - type
    WhoisResponse:
      type: object
      properties:
        domain:
          type: string
        registrar:
          oneOf:
          - $ref: '#/components/schemas/WhoisRegistrar'
          - type: 'null'
        registered_on:
          type: string
        expires_on:
          type: string
        updated_on:
          type: string
        name_servers:
          type: array
          items:
            type: string
        status:
          type: array
          items:
            $ref: '#/components/schemas/WhoisStatus'
        raw:
          type: string
        error:
          type:
          - string
          - 'null'
      required:
      - domain
      - name_servers
      - raw
      - status
    ForwardDnsResponse:
      type: object
      properties:
        hostname:
          type: string
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/ForwardLookupRecord'
      required:
      - addresses
      - hostname
    WhoisRegistrar:
      type: object
      properties:
        name:
          type:
          - string
          - 'null'
        url:
          type:
          - string
          - 'null'
        iana_id:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: api_key
      description: API key (free key generated on signup at https://ip-api.io)