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

# Create a DNS record

> Requires the domain to use OrbitLab nameservers (or be registered with us).

Requires the **owner or admin** role in the organization.

CLI: `orbitlab dns add <domain> <name> <type> <value>`



## OpenAPI

````yaml /api-reference/openapi.json post /v1/domains/{id}/records
openapi: 3.1.0
info:
  title: OrbitLab API
  version: 1.0.0
  description: >-
    Manage OrbitLab services, deployments, domains, DNS, databases,
    organizations and billing programmatically. Authenticate with an API token:
    `Authorization: Bearer olab_…`.
servers:
  - url: https://orbitlab.dev/api
    description: Production
security: []
tags:
  - name: Authentication
    description: CLI device login.
  - name: User
    description: The authenticated user and their API tokens.
  - name: Organizations
    description: Organizations, members and invitations.
  - name: Catalog
    description: Plans and deployable templates.
  - name: Services
    description: 'Apps, WordPress sites and VPS: configuration, deployments and environment.'
  - name: Logs & metrics
    description: Build logs, runtime logs, request logs and resource usage.
  - name: Service domains
    description: Custom domains attached to a service.
  - name: Files
    description: File manager and SFTP access.
  - name: WordPress
    description: Managed actions (WP-CLI) and admin reset.
  - name: Hostings
    description: Shared hosting subscriptions and their websites.
  - name: Domains
    description: Domain registration, settings and DNS records.
  - name: Databases
    description: Managed databases.
  - name: Billing
    description: Checkout, orders, invoices, renewals and autopay.
  - name: GitHub
    description: GitHub App installations and repositories.
paths:
  /v1/domains/{id}/records:
    post:
      tags:
        - Domains
      summary: Create a DNS record
      description: >-
        Requires the domain to use OrbitLab nameservers (or be registered with
        us).


        Requires the **owner or admin** role in the organization.


        CLI: `orbitlab dns add <domain> <name> <type> <value>`
      operationId: postDomainsByIdRecords
      parameters:
        - name: id
          in: path
          required: true
          description: Domain id.
          schema:
            type: string
        - $ref: '#/components/parameters/OrgHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: Record type.
                  enum:
                    - A
                    - AAAA
                    - CNAME
                    - MX
                    - TXT
                    - NS
                    - SRV
                subdomain:
                  type: string
                  description: Name below the domain; "" or omitted for the apex.
                value:
                  type: string
                  description: Record value.
                ttl:
                  type: integer
                  description: TTL in seconds (60–604800). Defaults to 3600.
                priority:
                  type: integer
                  description: MX priority.
              required:
                - type
                - value
      responses:
        '200':
          description: The created record.
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid or expired credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Not allowed: requires the owner or admin role, or the token cannot
            access this organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited; see the Retry-After header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - sessionCookie: []
components:
  parameters:
    OrgHeader:
      name: X-OrbitLab-Org
      in: header
      required: false
      description: >-
        Organization to act on (id or slug) for tokens that can access several
        organizations. Defaults to your first organization.
      schema:
        type: string
  schemas:
    Error:
      type: object
      properties:
        error:
          description: Error message (a string, or field errors for validation failures).
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API token (`olab_…`) created in Settings → API tokens or with `orbitlab
        login`.
    sessionCookie:
      type: apiKey
      in: cookie
      name: authjs.session-token
      description: Dashboard browser session.

````