• Domain Name Service

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

Creating a Public Zone

Function

Create a public zone.

URI

POST /v2/zones

Request

  • Parameter description
    Table 1 Parameters in the request

    Parameter

    Mandatory

    Type

    Description

    name

    Yes

    string

    Domain name registered with the domain name registrar

    • 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

    No

    string

    Zone type, the value of which can be public or private

    • public: public zones accessible to hosts on the Internet
    • private: private zones accessible only to hosts in specified VPCs

    If the value is left blank, a public zone will be created. For details about creating a private zone, see section Creating a Private 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.

    tags

    No

    List<tag>

    Resource tag. For details, see Table 2.

    Table 2 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": "public",
        "email": "xx@example.org"
    }

Response

  • Parameter description
    Table 3 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

  • Example response
    {
        "id": "2c9eb155587194ec01587224c9f90149",
        "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/2c9eb155587194ec01587224c9f90149"
        },
        "pool_id": "00000000570e54ee01570e9939b20019",
        "project_id": "e55c6f3dc4e34c9f86353b664ae0e70c",
        "zone_type": "public",
        "created_at": "2016-11-17T11:56:03.439",
        "updated_at": null,
        "record_num": 0
    }
    

Returned Value

See General Request Return Code.