• Domain Name Service

dns
  1. Help Center
  2. Domain Name Service
  3. API Reference
  4. API Description
  5. Record Set Management
  6. Modifying a Record Set

Modifying a Record Set

Function

Modify a record set.

URI

PUT /v2/zones/{zone_id}/recordsets/{recordset_id}

For details, see Table 1.
Table 1 Parameters in the URI

Parameter

Mandatory

Description

zone_id

Yes

Zone ID

recordset_id

Yes

ID of the record set to be modified

Request

  • Parameter description
    Table 2 Parameters in the request

    Parameter

    Mandatory

    Type

    Description

    description

    No

    string

    (Optional) Description for the domain name

    The value cannot exceed 255 characters.

    ttl

    No

    int

    Caching period of the record set (in seconds)

    The default value is 300s.

    The value range is 300–2147483647.

    records

    Yes

    List<string>

    Record set value, which varies depending on the record set type.

    For example, the value of an AAAA record set is the IPv6 address list mapped to the domain name.

    For details, see section "Managing Record Sets" in the Domain Name Service User Guide.

  • Example request
    • A type
      {
          "description": "This is an example record set.",
          "ttl": 3600,
          "records": [
              "192.168.10.1",
              "192.168.10.2"
          ]
      }
    • AAAA type
      {
          "description": "This is an example record set.",
          "ttl": 3600,
          "records": [
              "fe80:0:0:0:202:b3ff:fe1e:8329",
              "ff03:0db8:85a3:0:0:8a2e:0370:7334"
          ]
      }
    • MX type
      {
          "description": "This is an example record set.",
          "ttl": 3600,
          "records": [
              "1 mail.example.com"
          ]
      }
    • CNAME type
      {
          "description": "This is an example record set.",
          "ttl": 3600,
          "records": [
              "server1.example.com"
          ]
      }
    • TXT type
      {
          "description": "This is an example record set.",
          "ttl": 300,
          "records": [
              "\"This host is used for sale.\""
          ]
      }
    • NS type
      {
          "description": "This is an example record set.",
          "ttl": 300,
          "records": [
              "node1.example.com.",
              "node2.example.com."
          ]
      }
    • SRV type
      {
          "description": "This is an example record set.",
          "ttl": 3600,
          "records": [
              "3 60 2176 sipserver.example.com.",
              "10 100 2176 sipserver.example.com."
          ]
      }
    • PTR type
      {
          "description": "This is an example record set.",
          "ttl": 3600,
          "records": [
              "host.example.com."
      
          ]
      }
      
    • CAA type
      {
          "name": "www.example.com.",
          "description": "This is an example record set.",
          "type": "CAA",
          "ttl": 300,
          "records": [
              "0 issue \"example.com\"",
              "0 issuewild \"www.certinomis.com\"",
              "0 iodef \"mailto:xx@example.org\"",
              "0 iodef \"http://iodef.example.com\""
          ]
      }

Response

  • Parameter description
    Table 3 Parameters in the response

    Parameter

    Type

    Description

    id

    string

    Record set ID

    name

    string

    Record set name

    description

    string

    Record set description

    zone_id

    string

    Zone ID of the record set

    zone_name

    string

    Zone name of the record set

    type

    string

    Record set type

    The value can be A, AAAA, MX, CNAME, TXT, NS (only in public zones), SRV, PTR (only in private zones), and CAA (only in public zones).

    ttl

    int

    Caching period of a domain name (in seconds)

    A longer caching period makes a change on the authoritative DNS server take longer time to be synchronized to other DNS servers.

    records

    List<string>

    Domain name resolution result

    create_at

    string

    Time when the record set was created

    update_at

    string

    Time when the record set was updated

    status

    enum

    Resource status, which can be PENDING_CREATE, ACTIVE, PENDING_DELETE, PENDING_UPDATE, or ERROR

    default

    boolean

    Whether the record set is created by default

    A default record set cannot be deleted or modified.

    project_id

    string

    Project ID of the record set

    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.

  • Example response
    {
        "id": "2c9eb155587228570158722b6ac30007",
        "name": "www.example.com.",
        "description": "This is an example record set.",
        "type": "A",
        "ttl": 3600,
        "records": [
            "192.168.10.1",
            "192.168.10.2"
        ],
        "status": "PENDING_UPDATE",
        "links": {
            "self": "https://Endpoint/v2/zones/2c9eb155587194ec01587224c9f90149/recordsets/2c9eb155587228570158722b6ac30007"
        },
        "zone_id": "2c9eb155587194ec01587224c9f90149",
        "zone_name": "example.com.",
        "create_at": "2016-11-17T12:03:17.827",
        "update_at": "2016-11-17T12:56:03.827",
        "default": false,
        "project_id": "e55c6f3dc4e34c9f86353b664ae0e70c"
    }

Returned Value

See General Request Return Code.