Canonical: https://weaveos.com/reference/cloudflare/update-dns-record

1. [Software capabilities](https://weaveos.com/reference)
2. /[Cloudflare](https://weaveos.com/reference/cloudflare)
3. /Update or overwrite a DNS record

[![](https://weaveos.com/reference/logos/cloudflare.svg)Cloudflare](https://weaveos.com/reference/cloudflare)

# Update or overwrite a DNS record

Update an existing DNS record with PATCH or overwrite it with PUT. The TypeScript client exposes these operations as edit and update, respectively.

Documentation reviewed November 26, 2026 · 4 methods with sources

## Ways to do it

1. [1API: PATCH /zones/{zone\_id}/dns\_records/{dns\_record\_id}](https://weaveos.com/reference/cloudflare/update-dns-record#method-1)
2. [2SDK: client.dns.records.edit()](https://weaveos.com/reference/cloudflare/update-dns-record#method-2)
3. [3API: PUT /zones/{zone\_id}/dns\_records/{dns\_record\_id}](https://weaveos.com/reference/cloudflare/update-dns-record#method-3)
4. [4SDK: client.dns.records.update()](https://weaveos.com/reference/cloudflare/update-dns-record#method-4)

API

### PATCH /zones/{zone\_id}/dns\_records/{dns\_record\_id}

Change selected fields on an existing record.

[Read source: Cloudflare API: Update DNS Record](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/edit/)

- Requirements

  A zone ID, record ID, an API token with DNS Write when using token auth, and a JSON body with the changes.

- Limitations

  The editable fields depend on the record type. The endpoint documentation requires priority for MX and URI records.

SDK

### client.dns.records.edit()

Call client.dns.records.edit to apply the PATCH operation.

[Read source: Generated Cloudflare TypeScript DNS method: PATCH /zones/{zone\_id}/dns\_records/{dns\_record\_id}](https://github.com/cloudflare/cloudflare-typescript/blob/0eb9ef0ea40c1fe38e4b19be92f41bd7466bc1d6/src/resources/dns/api.md#L71)

- Requirements

  An authenticated Cloudflare TypeScript client, dnsRecordID, and RecordEditParams with zone\_id, name, ttl, type, and any record-specific fields.

- Limitations

  Version 7.4.0 types priority as optional. The endpoint documentation requires it for MX and URI records.

API

### PUT /zones/{zone\_id}/dns\_records/{dns\_record\_id}

Replace the existing record with the supplied values.

[Read source: Cloudflare API: Overwrite DNS Record](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/update/)

- Requirements

  A zone ID, record ID, an API token with DNS Write when using token auth, and a JSON body describing the replacement.

- Limitations

  Use PATCH for a partial change. The endpoint documentation requires priority for MX and URI records.

SDK

### client.dns.records.update()

Call client.dns.records.update to apply the PUT operation.

[Read source: Generated Cloudflare TypeScript DNS method: PUT /zones/{zone\_id}/dns\_records/{dns\_record\_id}](https://github.com/cloudflare/cloudflare-typescript/blob/0eb9ef0ea40c1fe38e4b19be92f41bd7466bc1d6/src/resources/dns/api.md#L67)

- Requirements

  An authenticated Cloudflare TypeScript client, dnsRecordID, and RecordUpdateParams with zone\_id, name, ttl, type, and any record-specific fields.

- Limitations

  Version 7.4.0 types priority as optional. The endpoint documentation requires it for MX and URI records.

[Previous Cloudflare taskExport DNS records as a BIND zone file](https://weaveos.com/reference/cloudflare/export-dns-records)

## More from Cloudflare

[View all 8 Cloudflare tasks](https://weaveos.com/reference/cloudflare)

- ### [List DNS records in a Cloudflare zone](https://weaveos.com/reference/cloudflare/list-zone-dns-records)

  Use the DNS Records API or Cloudflare TypeScript SDK to retrieve a zone’s records. The DNS Records page lets you inspect a record while working in the dashboard.

  API, SDK, Interface

- ### [Tail Cloudflare Worker logs](https://weaveos.com/reference/cloudflare/tail-worker-logs)

  Use wrangler tail to see incoming Worker requests and errors in your terminal. Use the dashboard’s Live view when you want to inspect the same stream in a browser.

  CLI, Interface

- ### [Find a Cloudflare zone ID](https://weaveos.com/reference/cloudflare/find-zone-id)

  Filter the Zones API by domain name when a script needs the ID. In the dashboard, copy it from the domain’s Overview page.

  API, Interface

- ### [Create a DNS record](https://weaveos.com/reference/cloudflare/create-dns-record)

  Create a record in a zone through the DNS Records API or the Cloudflare TypeScript client.

  API, SDK

## The same task in other apps

- [![](https://weaveos.com/reference/logos/github.svg)GitHub](https://weaveos.com/reference/github)

  ### [Read a GitHub pull request diff](https://weaveos.com/reference/github/read-pull-request-diff)

  Use the diff media type for a raw REST response. The GitHub CLI and GitHub MCP server can fetch the same pull request changes from a terminal or agent.

  API, CLI, MCP

- [![](https://weaveos.com/reference/logos/airtable.svg)Airtable](https://weaveos.com/reference/airtable)

  ### [How to update an Airtable record](https://weaveos.com/reference/airtable/update-record)

  PATCH the record endpoint to change specific fields by record ID. In an Airtable interface, use the record detail page to make the same edit manually when editing is enabled.

  API, Interface
