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

# Create DNS Record

> Create a new DNS record for the domain.



## OpenAPI

````yaml post /domains/{domain}/dns
openapi: 3.1.0
info:
  title: APIFiddle Sample Definition
  version: 0.0.0
  description: Example workspace
servers:
  - url: https://rdp.sh/api/v1
    description: Default production endpoint.
security: []
paths:
  /domains/{domain}/dns:
    post:
      summary: Create DNS record
      description: Create a new DNS record for the domain.
      operationId: createDnsRecord
      parameters:
        - $ref: '#/components/parameters/domain'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/dnsRecordInput'
      responses:
        '201':
          content:
            application/json:
              schema:
                type: object
                title: CreateDnsRecordOk
                properties:
                  status:
                    type: boolean
                    examples:
                      - true
                  message:
                    type: string
                    examples:
                      - DNS record added
                  record:
                    $ref: '#/components/schemas/dnsRecord'
          description: DNS record created successfully.
        '403':
          description: User does not own the domain, or the domain is suspended.
        '422':
          description: Validation error, or DNS management is unavailable for this domain.
      security:
        - Authorization: []
components:
  parameters:
    domain:
      in: path
      name: domain
      schema:
        type: integer
      required: true
      description: Domain ID
  schemas:
    dnsRecordInput:
      type: object
      required:
        - type
        - name
        - value
      properties:
        type:
          type: string
          enum:
            - A
            - AAAA
            - CNAME
            - MX
            - TXT
            - NS
            - SRV
            - CAA
          description: DNS record type.
        name:
          type: string
          maxLength: 255
          description: Record name. Use `@` for the apex/root.
          examples:
            - '@'
        value:
          type: string
          maxLength: 1000
          description: Record value (e.g. an IP address, hostname, or text).
          examples:
            - 185.241.208.160
        ttl:
          type: integer
          minimum: 60
          maximum: 86400
          default: 3600
          description: Time-to-live in seconds (60-86400). Defaults to 3600.
        priority:
          type: integer
          minimum: 0
          maximum: 65535
          nullable: true
          description: Priority for MX and SRV records.
      description: Payload for creating or updating a DNS record.
    dnsRecord:
      type: object
      required: []
      properties:
        id:
          type: integer
          examples:
            - 42
        type:
          type: string
          enum:
            - A
            - AAAA
            - CNAME
            - MX
            - TXT
            - NS
            - SRV
            - CAA
          examples:
            - A
        name:
          type: string
          description: Record name. Use `@` for the apex/root.
          examples:
            - '@'
            - www
        value:
          type: string
          examples:
            - 185.241.208.160
        ttl:
          type: integer
          examples:
            - 3600
        priority:
          type: integer
          nullable: true
          description: Priority, used by MX and SRV records.
          examples:
            - 10
        created_at:
          type: string
          examples:
            - '2025-01-01T00:00:00.000000Z'
      description: DNS record object.
  securitySchemes:
    Authorization:
      in: header
      name: Authorization
      type: apiKey

````