# Get dns records 

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/dns/:
    get:
      summary: 'Get dns records '
      deprecated: false
      description: >-
        Fetch all DNS records for a domain associated with a user by providing
        the domain ID.
      tags:
        - dns
      parameters:
        - name: id
          in: query
          description: ''
          required: true
          example: '{{domain-id}}'
          schema:
            type: string
        - name: x-auth-zapmail
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
        - name: x-workspace-key
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
        - name: ' x-service-provider'
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      records:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            assignedDomainId:
                              type: string
                            cdfRecordId:
                              type: string
                            cdfResponse:
                              type: object
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                                type:
                                  type: string
                                content:
                                  type: string
                              required:
                                - id
                                - name
                                - type
                                - content
                              x-apidog-orders:
                                - id
                                - name
                                - type
                                - content
                            recordType:
                              type: string
                            value:
                              type: string
                            host:
                              type: string
                            priority:
                              type: 'null'
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                            deletedAt:
                              type: 'null'
                          required:
                            - id
                            - assignedDomainId
                            - cdfRecordId
                            - cdfResponse
                            - recordType
                            - value
                            - host
                            - priority
                            - createdAt
                            - updatedAt
                            - deletedAt
                          x-apidog-orders:
                            - id
                            - assignedDomainId
                            - cdfRecordId
                            - cdfResponse
                            - recordType
                            - value
                            - host
                            - priority
                            - createdAt
                            - updatedAt
                            - deletedAt
                      disabledRecords:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            zone_id:
                              type: string
                            name:
                              type: string
                            type:
                              type: string
                            content:
                              type: string
                            ttl:
                              type: integer
                          required:
                            - id
                            - zone_id
                            - name
                            - type
                            - content
                            - ttl
                          x-apidog-orders:
                            - id
                            - zone_id
                            - name
                            - type
                            - content
                            - ttl
                    required:
                      - records
                      - disabledRecords
                    x-apidog-orders:
                      - records
                      - disabledRecords
                required:
                  - status
                  - message
                  - data
                x-apidog-orders:
                  - status
                  - message
                  - data
              example:
                status: 200
                message: DNS records fetched successfully
                data:
                  records:
                    - id: c1a9e4b2-7a5f-4f2a-8f0c-6d9e2a1b5f3e
                      assignedDomainId: d4b7f2c3-1f2a-4e9b-8c6d-2a3f4b5c6d7e
                      cdfRecordId: f9a2b4c6-3d1e-4f7b-9a0d-1c2b3e4f5a6b
                      cdfResponse:
                        id: f9a2b4c6-3d1e-4f7b-9a0d-1c2b3e4f5a6b
                        name: dummy.com.dns-records.test
                        type: A
                        content: 123.123.123.123
                      recordType: A
                      value: 123.123.123.123
                      host: dummy.com
                      priority: null
                      createdAt: '2025-01-31T09:03:21.984Z'
                      updatedAt: '2025-01-31T09:03:21.984Z'
                      deletedAt: null
                    - id: e2b3c4d5-6f7a-4b8c-9d0e-1f2a3b4c5d6e
                      assignedDomainId: d4b7f2c3-1f2a-4e9b-8c6d-2a3f4b5c6d7e
                      cdfRecordId: a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d
                      cdfResponse:
                        id: a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d
                        name: mail.dummy.com.dns-records.test
                        type: CNAME
                        content: dummy-mailserver.com
                      recordType: CNAME
                      value: dummy-mailserver.com
                      host: mail.dummy.com
                      priority: null
                      createdAt: '2025-01-31T09:03:21.984Z'
                      updatedAt: '2025-01-31T09:03:21.984Z'
                      deletedAt: null
                  disabledRecords:
                    - id: b1c2d3e4-5f6a-7b8c-9d0e-1f2a3b4c5d6e
                      zone_id: z1a2b3c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c
                      name: mail.dummy.com.dns-records.test
                      type: CNAME
                      content: dummy-mailserver.com
                      ttl: 1
                    - id: c2d3e4f5-6a7b-8c9d-0e1f-2a3b4c5d6e7f
                      zone_id: z1a2b3c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c
                      name: _dmarc.dns-records.test
                      type: TXT
                      content: >-
                        v=DMARC1; p=reject; rua=mailto:dummy@dummy.com;
                        ruf=mailto:dummy@dummy.com; fo=0; pct=100; rf=afrf;
                        ri=604800; sp=reject; aspf=r; adkim=r
                      ttl: 1
          headers: {}
          x-apidog-name: Success
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  errorId:
                    type: string
                required:
                  - status
                  - message
                  - errorId
                x-apidog-orders:
                  - status
                  - message
                  - errorId
              example:
                status: 400
                message: Domain is not registered
                errorId: a837f618-6ba1-4c90-a9e2-e48934980f67
          headers: {}
          x-apidog-name: Not registered
      security: []
      x-apidog-folder: dns
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/797058/apis/api-13627177-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.zapmail.ai/api
    description: Prod Env
security: []

```
