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

# Import Zone

> Import zone in bind9 format.



## OpenAPI

````yaml /api-reference/services_documented/dns_api.yaml post /dns/v2/zones/{zoneName}/import
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-14T07:00:22.640261+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/{zoneName}/import:
    post:
      tags:
        - Zones
      summary: Import Zone
      description: Import zone in bind9 format.
      operationId: ImportZone
      parameters:
        - name: zoneName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Reader'
        required: false
      responses:
        '200':
          description: ImportZoneResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportZoneResponse'
        '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
            )
            response = client.dns.zones.import_(
                zone_name="zoneName",
            )
            print(response.imported)
        - 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\tresponse, err := client.DNS.Zones.Import(\n\t\tcontext.TODO(),\n\t\t\"zoneName\",\n\t\tdns.ZoneImportParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Imported)\n}\n"
components:
  schemas:
    Reader:
      title: Reader is the interface that wraps the basic Read method.
      type: object
      description: >-
        Read reads up to len(p) bytes into p. It returns the number of bytes

        read (0 <= n <= len(p)) and any error encountered. Even if Read

        returns n < len(p), it may use all of p as scratch space during the
        call.

        If some data is available but not len(p) bytes, Read conventionally

        returns what is available instead of waiting for more.


        When Read encounters an error or end-of-file condition after

        successfully reading n > 0 bytes, it returns the number of

        bytes read. It may return the (non-nil) error from the same call

        or return the error (and n == 0) from a subsequent call.

        An instance of this general case is that a Reader returning

        a non-zero number of bytes at the end of the input stream may

        return either err == EOF or err == nil. The next Read should

        return 0, EOF.


        Callers should always process the n > 0 bytes returned before

        considering the error err. Doing so correctly handles I/O errors

        that happen after reading some bytes and also both of the

        allowed EOF behaviors.


        If len(p) == 0, Read should always return n == 0. It may return a

        non-nil error if some error condition is known, such as EOF.


        Implementations of Read are discouraged from returning a

        zero byte count with a nil error, except when len(p) == 0.

        Callers should treat a return of 0 and nil as indicating that

        nothing happened; in particular it does not indicate EOF.


        Implementations must not retain p.
    ImportZoneResponse:
      type: object
      properties:
        imported:
          $ref: '#/components/schemas/ImportedRRSets'
        success:
          type: boolean
        warnings:
          $ref: '#/components/schemas/Warnings'
    ImportedRRSets:
      type: object
      properties:
        qtype:
          type: integer
          format: uint64
        resource_records:
          type: integer
          format: uint64
        rrsets:
          type: integer
          format: uint64
        skipped_resource_records:
          type: integer
          format: uint64
      description: ImportedRRSets - import statistics
    Warnings:
      type: object
      additionalProperties:
        type: object
        additionalProperties:
          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

````