> ## 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.

# Update Nameservers

> Switch a domain between RDP.sh-managed nameservers and custom external
nameservers.




## OpenAPI

````yaml put /domains/{domain}/nameservers
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}/nameservers:
    put:
      summary: Update nameservers
      description: |
        Switch a domain between RDP.sh-managed nameservers and custom external
        nameservers.
      operationId: updateNameservers
      parameters:
        - $ref: '#/components/parameters/domain'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - use_rdp_nameservers
              properties:
                use_rdp_nameservers:
                  type: boolean
                  description: >
                    When `true`, the domain is switched to RDP.sh nameservers
                    and

                    its DNS is managed through this API. When `false`, you must

                    supply your own `nameservers`.
                nameservers:
                  type: array
                  minItems: 2
                  maxItems: 6
                  description: |
                    Custom nameservers (2-6). Required when
                    `use_rdp_nameservers` is `false`.
                  items:
                    type: string
                    examples:
                      - ns1.example.com
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                title: UpdateNameserversOk
                properties:
                  status:
                    type: boolean
                    examples:
                      - true
                  message:
                    type: string
                    examples:
                      - Nameservers updated
                  domain:
                    $ref: '#/components/schemas/domain'
          description: Nameservers updated successfully.
        '403':
          description: User does not own the domain, or the domain is suspended.
        '422':
          description: Validation error.
        '500':
          description: Failed to update nameservers.
      security:
        - Authorization: []
components:
  parameters:
    domain:
      in: path
      name: domain
      schema:
        type: integer
      required: true
      description: Domain ID
  schemas:
    domain:
      type: object
      required: []
      properties:
        id:
          type: integer
          examples:
            - 1
        domain_name:
          type: string
          examples:
            - example.com
        status:
          type: string
          description: Domain lifecycle status.
          examples:
            - active
            - suspended
            - transferring
            - expired
        provider:
          type: string
          description: Registrar backing the domain.
          examples:
            - internetbs
            - netim
        auto_renew:
          type: boolean
        whois_privacy:
          type: boolean
        lock_status:
          type: boolean
          description: Whether the registrar transfer lock is enabled.
        use_rdp_nameservers:
          type: boolean
          description: Whether the domain uses RDP.sh-managed nameservers.
        nameservers:
          type: array
          items:
            type: string
          examples:
            - ns1.rdp.sh
            - ns2.rdp.rs
        registration_date:
          type: string
          nullable: true
          examples:
            - '2025-01-01T00:00:00.000000Z'
        expiry_date:
          type: string
          nullable: true
          examples:
            - '2027-01-01T00:00:00.000000Z'
        days_until_expiry:
          type: integer
          nullable: true
          examples:
            - 180
        is_expiring_soon:
          type: boolean
          description: True when the domain expires within 30 days.
        dns_records_count:
          type: integer
          examples:
            - 2
        created_at:
          type: string
          examples:
            - '2025-01-01T00:00:00.000000Z'
      description: Domain object.
  securitySchemes:
    Authorization:
      in: header
      name: Authorization
      type: apiKey

````