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

# Create Zone

> Add DNS zone.



## OpenAPI

````yaml /api-reference/services_documented/dns_api.yaml post /dns/v2/zones
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: '2026-05-11T15:10:30.328297+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Analyze
    x-displayName: Analyze
  - name: DNS Locations
    x-displayName: DNS Locations
  - name: Lookup
    x-displayName: Lookup
  - name: Metrics
    x-displayName: Metrics
  - name: NetworkMappings
    x-displayName: NetworkMappings
  - name: Pickers
    x-displayName: Pickers
  - name: DNS Clients
    x-displayName: DNS Clients
  - name: Zones
    x-displayName: Zones
  - name: DNSSEC
    x-displayName: DNSSEC
  - name: RRsets
    x-displayName: RRsets
paths:
  /dns/v2/zones:
    post:
      tags:
        - Zones
      summary: Create Zone
      description: Add DNS zone.
      operationId: CreateZone
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InputZone'
        required: false
      responses:
        '200':
          description: CreateZoneResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateZoneResponse'
        '400':
          description: Error message response
          headers:
            error:
              schema:
                type: string
          content: {}
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            zone = client.dns.zones.create(
                name="example.com",
            )
            print(zone.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/dns\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tzone, err := client.DNS.Zones.New(context.TODO(), dns.ZoneNewParams{\n\t\tName: \"example.com\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", zone.ID)\n}\n"
components:
  schemas:
    InputZone:
      required:
        - name
      type: object
      properties:
        contact:
          type: string
          description: email address of the administrator responsible for this zone
          x-stainless-terraform-configurability: computed_optional
        enabled:
          type: boolean
          description: >-
            If a zone is disabled, then its records will not be resolved on dns
            servers
          default: true
        expiry:
          type: integer
          description: >-
            number of seconds after which secondary name servers should stop
            answering request for this zone
          format: uint64
          x-stainless-terraform-configurability: computed_optional
        meta:
          type: object
          additionalProperties:
            type: object
          description: >-
            arbitrarily data of zone in json format

            you can specify `webhook` url and `webhook_method` here

            webhook will get a map with three arrays: for created, updated and
            deleted rrsets

            `webhook_method` can be omitted, POST will be used by default
          example:
            webhook: http://example.com/hook
            webhook_method: PUT
        name:
          type: string
          description: name of DNS zone
          example: example.com
        nx_ttl:
          type: integer
          description: Time To Live of cache
          format: uint64
          x-stainless-terraform-configurability: computed_optional
        primary_server:
          type: string
          description: primary master name server for zone
          x-stainless-terraform-configurability: computed_optional
        refresh:
          type: integer
          description: >-
            number of seconds after which secondary name servers should query
            the master for the SOA record, to detect zone changes.
          format: uint64
          x-stainless-terraform-configurability: computed_optional
        retry:
          type: integer
          description: >-
            number of seconds after which secondary name servers should retry to
            request the serial number
          format: uint64
          x-stainless-terraform-configurability: computed_optional
        serial:
          type: integer
          description: >-
            Serial number for this zone or Timestamp of zone modification
            moment.

            If a secondary name server slaved to this one observes an increase
            in this number,

            the slave will assume that the zone has been updated and initiate a
            zone transfer.
          format: uint64
          x-stainless-terraform-configurability: computed
    CreateZoneResponse:
      type: object
      properties:
        id:
          type: integer
          format: uint64
        warnings:
          $ref: '#/components/schemas/SimpleWarnings'
    SimpleWarnings:
      type: array
      items:
        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

````