> ## Documentation Index
> Fetch the complete documentation index at: https://docs.geekflare.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DNS Records



## OpenAPI

````yaml POST /dnsrecord
openapi: 3.1.0
info:
  title: Geekflare
  description: Official OpenAPI specification for all Geekflare endpoints.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.geekflare.com
security:
  - x-api-key: []
paths:
  /dnsrecord:
    post:
      tags:
        - api-tool
      summary: Retrieve DNS records for a given domain
      operationId: dnsRecord
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DnsRecordDto'
      responses:
        '200':
          description: Successfully retrieved DNS records
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DnsRecordResponseDto'
        '400':
          description: Invalid URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 400
                message: INVALID_URL
                details: The URL must be a valid HTTP or HTTPS URL.
        '500':
          description: DNS lookup failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 500
                message: DNS_LOOKUP_FAILED
                details: DNS lookup failed for the requested domain.
components:
  schemas:
    DnsRecordDto:
      type: object
      properties:
        url:
          type: string
          description: Target URL
          example: https://example.com
        types:
          type: array
          description: >-
            List of DNS record types to query. If omitted, all supported types
            will be returned.
          example:
            - A
            - MX
          items:
            type: string
            enum:
              - A
              - AAAA
              - CNAME
              - MX
              - CAA
              - NS
              - SOA
              - SRV
              - TXT
      required:
        - url
    DnsRecordResponseDto:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the request in milliseconds
          example: 1783943217189
        apiStatus:
          type: string
          description: API status message
          example: success
          enum:
            - success
            - failure
        apiCode:
          type: number
          description: API status code
          example: 200
        meta:
          description: Metadata about the request.
          example:
            url: example.com
            types:
              - A
              - MX
            test:
              id: zmkqoxxu075dwn4u61yoqhq2rwo0029m
          allOf:
            - $ref: '#/components/schemas/DnsMetaDto'
        data:
          type: object
          description: DNS records grouped by type.
          example:
            A:
              - 172.67.70.213
              - 104.26.11.88
              - 104.26.10.88
            MX:
              - exchange: alt3.aspmx.l.google.com
                priority: 10
              - exchange: aspmx.l.google.com
                priority: 1
      required:
        - timestamp
        - apiStatus
        - apiCode
        - meta
        - data
    BaseErrorResponseDto:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the request in milliseconds
          example: 1778737930991
        apiStatus:
          type: string
          description: API status message
          example: success
          enum:
            - success
            - failure
        apiCode:
          type: number
          description: API status code
          example: 200
        message:
          type: string
          description: Error message
          example: Invalid URL provided
        details:
          type: string
          description: Detailed error information
          example: The URL must be a valid HTTP or HTTPS URL
      required:
        - timestamp
        - apiStatus
        - apiCode
        - message
    DnsMetaDto:
      type: object
      properties:
        url:
          type: string
          description: The target URL that was scraped
          example: https://example.com
        types:
          type: string
          description: >-
            List of DNS record types to query. If omitted, all supported types
            will be returned.
          example:
            - A
            - MX
          enum:
            - A
            - AAAA
            - CNAME
            - MX
            - CAA
            - NS
            - SOA
            - SRV
            - TXT
        test:
          description: Test details object
          allOf:
            - $ref: '#/components/schemas/TestMetaDto'
      required:
        - url
        - types
        - test
    TestMetaDto:
      type: object
      properties:
        id:
          type: string
          description: Unique test identifier
          example: mxqx9v9y0742lap6altwdteqd28t23nq
      required:
        - id
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key required for all endpoints

````