• Domain Name Service

dns
  1. Help Center
  2. Domain Name Service
  3. API Reference
  4. API Description
  5. Private Zone Management
  6. Creating a Private Zone

Creating a Private Zone

Function

Create a private zone.

URI

POST /v2/zones

Request

  • Parameter description
    Table 1 Parameters in the request

    Parameter

    Mandatory

    Type

    Description

    name

    Yes

    string

    Domain name of the zone to be created

    • If a domain name is ended with a dot (.), it cannot exceed 254 characters.
    • Otherwise, the domain name cannot exceed 253 characters.
    • Labels of a domain name are separated by dot (.). Each label cannot exceed 63 characters.

    A domain name is case insensitive. Uppercase letters will also be converted into lowercase letters.

    description

    No

    string

    Description of the domain name, which cannot exceed 255 characters

    zone_type

    Yes

    string

    Zone type

    The value must be private, indicating private zones accessible only to hosts in specified VPCs will be created.

    For details about creating a public zone, see section Creating a Public Zone.

    email

    No

    string

    Email address of the administrator managing the zone

    ttl

    No

    int

    Caching period of the SOA record set (in seconds)

    The default value is 300s.

    The value range is 300–2147483647.

    router

    Yes

    object

    Router information (VPC associated with the private zone)

    For details, see Table 2.

    tags

    No

    tag

    Resource tag. For details, see Table 3.

    Table 2 Description of the router field

    Parameter

    Mandatory

    Type

    Description

    router_id

    Yes

    string

    Router ID (VPC ID)

    router_region

    No

    string

    Region of the router (VPC)

    If it is left blank, the region of the project in the token takes effect by default.

    Table 3 Description of the tag list

    Parameter

    Mandatory

    Type

    Description

    key

    Yes

    string

    Tag key. The key contains 36 Unicode characters at most and cannot be blank. It can contain only digits, letters, hyphens (-), and underscores (_).

    value

    Yes

    string

    Tag value. Each value contains 43 Unicode characters at most and can be an empty string. It can contain only digits, letters, hyphens (-), and underscores (_).

  • Example request
    {
        "name": "example.com.",
        "description": "This is an example zone.",
        "zone_type": "private",
        "email": "xx@example.org",
        "router": {
            "router_id": "19664294-0bf6-4271-ad3a-94b8c79c6558",
            "router_region": "xx"
        }
    }

Response

  • Parameter description
    Table 4 Parameters in the response

    Parameter

    Type

    Description

    id

    string

    Zone ID, which is a UUID used to identify the zone

    name

    string

    Zone name

    description

    string

    Zone description

    email

    string

    Email address of the administrator managing the zone

    zone_type

    string

    Zone type, which can be public or private

    ttl

    int

    TTL value of the SOA record set in the zone

    serial

    int

    Serial number in the SOA record set in the zone, which identifies the change on the primary DNS server

    status

    enum

    Resource status

    The value can be PENDING_CREATEACTIVEPENDING_DELETE, or ERROR.

    record_num

    int

    Number of record sets in the zone

    pool_id

    string

    Pool ID of the zone, which is assigned by the system

    project_id

    string

    Project ID of the zone

    created_at

    string

    Time when the zone was created

    updated_at

    string

    Time when the zone was updated

    links

    object

    Link of the current resource or other related resources

    When a response is broken into pages, a next link is provided to retrieve all results.

    masters

    enum

    Master DNS servers, from which the slave servers get DNS information

    router

    object

    Router information (VPC associated with the zone)

  • Example response
    {
        "id": "ff8080825b8fc86c015b94bc6f8712c3",
        "name": "example.com.",
        "description": "This is an example zone.",
        "email": "xx@example.com",
        "ttl": 300,
        "serial": 1,
        "masters": [],
        "status": "PENDING_CREATE",
        "links": {
            "self": "https://Endpoint/v2/zones/ff8080825b8fc86c015b94bc6f8712c3"
        },
        "pool_id": "ff8080825ab738f4015ab7513298010e",
        "project_id": "e55c6f3dc4e34c9f86353b664ae0e70c",
        "zone_type": "private",
        "created_at": "2017-04-22T08:17:08.997",
        "updated_at": null,
        "record_num": 0,
        "router": {
            "status": "PENDING_CREATE",
            "router_id": "19664294-0bf6-4271-ad3a-94b8c79c6558",
            "router_region": "xx"
        }
    }
    

Returned Value

See General Request Return Code.