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

# Create primary server

> Create a primary server for a secondary zone.



## OpenAPI

````yaml /api-reference/services_docs_mintlify_enriched/dns_api.yaml post /dns/v2/secondary-zones/{zoneName}/primaries
openapi: 3.1.0
info:
  title: Gcore OpenAPI – DNS API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: 0929afaaccd0
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Analyze
  - name: Clients
  - name: DNSSEC
  - name: Locations
  - name: Lookup
  - name: Metrics
  - name: NetworkMappings
  - name: Pickers
  - name: RRsets
  - name: SecondaryZones
  - name: Zones
paths:
  /dns/v2/secondary-zones/{zoneName}/primaries:
    post:
      tags:
        - SecondaryZones
      summary: Create primary server
      description: Create a primary server for a secondary zone.
      operationId: CreateSecondaryZonePrimary
      parameters:
        - name: zoneName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePrimaryServerPayload'
        required: true
      responses:
        '201':
          description: PrimaryServerResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrimaryServerResponse'
        '400':
          description: SecondaryZoneErrorResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecondaryZoneErrorResponse'
        '404':
          description: SecondaryZoneErrorResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecondaryZoneErrorResponse'
        '502':
          description: SecondaryZoneErrorResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecondaryZoneErrorResponse'
components:
  schemas:
    CreatePrimaryServerPayload:
      type: object
      properties:
        address:
          type: string
        meta:
          type: object
          additionalProperties:
            type: object
        priority:
          type: integer
          format: int64
    PrimaryServerResponse:
      type: object
      properties:
        address:
          type: string
        consecutive_failures:
          type: integer
          format: int64
        created_at:
          type: string
          format: date-time
        enabled:
          type: boolean
        id:
          type: integer
          format: int64
        last_error_at:
          type: string
          format: date-time
        last_error_msg:
          type: string
        last_success_at:
          type: string
          format: date-time
        meta:
          type: object
          additionalProperties:
            type: object
        priority:
          type: integer
          format: int64
        secondary_zone_id:
          type: integer
          format: int64
        updated_at:
          type: string
          format: date-time
    SecondaryZoneErrorResponse:
      type: object
      properties:
        code:
          type: string
        error:
          type: string
        message:
          type: string
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234_abcdef`
      type: apiKey
      in: header
      name: Authorization

````