cPanel WHM icon

cPanel WHM

Full cPanel WHM API — all 622 operations across Accounts, DNS, Mail, SSL, Backups, Databases and more

Actions262

DNS → Update a DNS zone

AI-generated

Summary

Update DNS zone records by specifying the DNS zone name and current SOA serial number to ensure synchronization. Modify the zone by adding, editing, or removing DNS records provided as serialized JSON objects or line indexes.

Inputs

  • Zone (required) — The name of one of the user’s DNS zones to update.
  • Serial (required) — The current serial number from the DNS zone’s SOA record; must match the zone's current state for the update to proceed.
  • Add — Serialized JSON array of DNS records to add. Each record must include dname (record name), ttl (time-to-live), record_type (e.g., 'A', 'TXT'), and data (record data).
  • Edit — Serialized JSON array of DNS records to edit. Each record must include line_index as a 0-based index indicating the record's position in the zone and record details for the update.
  • Remove — List of line indexes (0-based) identifying which DNS records to remove from the zone.

Output shape

a data object confirming the applied updates or error details if the operation fails

The operation requires the SOA serial number to match; otherwise, it fails. Inputs affecting the zone must be serialized JSON strings or lists encoding the desired changes. The response contains API feedback about the success or failure of the update.

Links

Discussion