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

# Create DNS Record

> Create a new DNS record.



## OpenAPI

````yaml POST /api/v1/registrar/dns/{domain_name}/records
openapi: 3.1.0
info:
  title: Dotlet API
  description: >-
    The Dotlet API lets you search, register, and manage domains, configure DNS
    records, and embed domain purchasing flows in your own product.


    All endpoints are authenticated with an API key or bearer token, and all
    request and response bodies are JSON.
  version: 0.1.1
  contact:
    name: Dotlet Support
    url: https://dotlet.net/support
    email: support@dotlet.net
servers:
  - url: https://api.dotlet.net
    description: Production
security: []
tags:
  - name: Domains
    description: Search, price, register, renew, and manage domains.
  - name: Orders
    description: Create and track domain orders separately from immediate purchases.
  - name: DNS
    description: Manage DNS records for domains hosted with Dotlet.
  - name: Hosted Sessions
    description: Create embeddable, scoped sessions for end users in your own product.
paths:
  /api/v1/registrar/dns/{domain_name}/records:
    post:
      tags:
        - DNS
      summary: Create Dns Record
      description: Create a new DNS record.
      operationId: create_dns_record_api_v1_dns__domain_name__records_post
      parameters:
        - name: domain_name
          in: path
          required: true
          schema:
            type: string
            title: Domain Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DNSRecordCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DNSRecordRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    DNSRecordCreate:
      properties:
        name:
          type: string
          title: Name
          description: Full record name (e.g., api.example.com)
        record_type:
          $ref: '#/components/schemas/app__providers__dns__dns_base__RecordType'
        content:
          type: string
          title: Content
          description: Record content (e.g., IP address)
        ttl:
          anyOf:
            - type: integer
            - type: 'null'
          title: Ttl
          description: Time to live in seconds
          default: 300
        priority:
          anyOf:
            - type: integer
            - type: 'null'
          title: Priority
          description: Priority for MX/SRV records
        proxied:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Proxied
          description: Whether the record is proxied (Cloudflare only)
          default: false
        domain_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Domain Id
          description: ID of the domain
        lease_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Lease Id
          description: ID of the lease (optional)
      type: object
      required:
        - name
        - record_type
        - content
      title: DNSRecordCreate
    DNSRecordRead:
      properties:
        name:
          type: string
          title: Name
          description: Full record name (e.g., api.example.com)
        record_type:
          $ref: '#/components/schemas/RecordType-Output'
        content:
          type: string
          title: Content
          description: Record content (e.g., IP address)
        ttl:
          anyOf:
            - type: integer
            - type: 'null'
          title: Ttl
          description: Time to live in seconds
          default: 300
        priority:
          anyOf:
            - type: integer
            - type: 'null'
          title: Priority
          description: Priority for MX/SRV records
        proxied:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Proxied
          description: Whether the record is proxied (Cloudflare only)
          default: false
        id:
          type: string
          format: uuid
          title: Id
        domain_id:
          type: string
          format: uuid
          title: Domain Id
        lease_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Lease Id
        provider_record_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Record Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - name
        - record_type
        - content
        - id
        - domain_id
        - created_at
      title: DNSRecordRead
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    app__providers__dns__dns_base__RecordType:
      type: string
      enum:
        - A
        - AAAA
        - CNAME
        - MX
        - TXT
        - NS
        - SRV
        - CAA
      title: RecordType
    RecordType-Output:
      type: string
      enum:
        - A
        - AAAA
        - CNAME
        - MX
        - TXT
        - NS
        - SRV
        - CAA
      title: RecordType
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````