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

Endpoint: GET /DNS/mass_edit_zone
Version: 11.136.0.13
Security: BasicAuth

## Query parameters:

  - `serial` (integer, required)
    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.
    Example: 202001010100

  - `zone` (string, required)
    The name of one of the user’s DNS zones.
    Example: "example.com"

  - `add` (array)
    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.

  - `edit` (array)
    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.
    Example: ["'{\"line_index\": 9, \"dname\":\"example\", \"ttl\":14400, \"record_type\":\"TXT\", \"data\":[\"string1\", \"string2\"]}'"]

  - `remove` (array)
    The line indexes of records to remove from the zone.
    Example: [22]

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "mass_edit_zone"

  - `module` (string)
    The name of the module called.
    Example: "DNS"

  - `result` (object)

  - `result.data` (object)

  - `result.data.new_serial` (integer)
    The DNS zone’s SOA record’s new serial number.
You can use this to submit later edits if you
track the number of lines each record takes up.
    Example: 2021031903

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    * 1 — Success.
* 0 — Failed. Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


