Add / update / delete DNS records (safe)
modify_dns_recordsModify DNS records safely without wiping the zone. Apply granular add, update, or delete operations while preserving untouched records.
Instructions
Change DNS records WITHOUT wiping the zone. This is the tool you almost always want. It reads the current records, applies your granular add/update/delete operations in memory, and writes the full merged set back — untouched records are preserved. Operations: add (name+type+address); update (matches name+type, optionally matchAddress to disambiguate; only provided fields change); delete (matches name+type, optionally matchAddress). If an operation would delete the LAST record, pass allowEmptyZone=true. Returns a before/after diff.
Read nonAtomicWarning on the result. On GoDaddy an edit is a delete followed by a create, because its v3 API has no record update: if the create fails the record is ABSENT, not stale. Namecheap and Route 53 apply an edit as one operation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Registrable domain, e.g. example.com | |
| provider | No | Force a provider instead of routing by domain. Needed when the domain does not exist yet (registration), and useful when a domain is at two providers and you mean a specific one. | |
| operations | Yes | Ordered list of changes to apply to the current zone. | |
| allowEmptyZone | No | Safety switch: required true if the result would leave the domain with zero records. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | ||
| failed | Yes | ||
| account | Yes | ||
| applied | Yes | ||
| changes | Yes | ||
| success | Yes | ||
| provider | Yes | ||
| environment | No | ||
| nonAtomicWarning | No | ||
| recordCountAfter | Yes | ||
| recordCountBefore | Yes |