v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
DNS
DNS Information

Update a DNS zone

This function updates a DNS zone by allowing multiple records to be added, modified, or removed in a single call. It also ensures modified records occupy the same number of lines as before the edit.

NOTE:

You cannot use this function to edit temporary domains.

get/DNS/mass_edit_zone

Query parameters

serialinteger required
Example:202001010100

The current serial number in the DNS zone’s SOA (Start of Authority) record. If this value does not match the zone’s current state, the request fails.

zonestring required
Example:example.com

The name of one of the user’s DNS zones.

addstring[]

The records to add to the zone. Each item must be a serialized JSON object that contains:

  • dname — The record’s name.
  • ttl — The record’s TTL (Time-To-Live) value.
  • record_type — The record’s type. For example, A or TXT.
  • data — An array of strings. The format and number of the strings depend on the record_type value.
editstring[]

The records to edit in the zone. Each item must be a serialized JSON object that contains:

  • line_index — The line number in the DNS zone where the record starts. This is a 0-based index, so to edit the first line in the file use the 0 value. To edit the second line, give 1, and so forth.
  • dname — The record’s name.
  • ttl — The record’s TTL (Time-To-Live) value.
  • record_type — The record’s new type. For example, A or TXT.
  • data — An array of strings. The format and number of the strings depend on the record_type value.
[
  "'{\"line_index\": 9, \"dname\":\"example\", \"ttl\":14400, \"record_type\":\"TXT\", \"data\":[\"string1\", \"string2\"]}'"
]
removeinteger[]

The line indexes of records to remove from the zone.

[
  22
]

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "mass_edit_zone",
  "module": "DNS",
  "result": {
    "data": {
      "new_serial": 2021031903
    },
    "metadata": {
      "transformed": 1
    },
    "status": 1
  }
}