---
title: "Update DNS Record"
method: POST
path: "/dnszone/{zoneId}/records/{id}"
tags: ["DNS Zone"]
---

# Update DNS Record

`POST /dnszone/{zoneId}/records/{id}`

## Request

- Base URL: `https://api.bunny.net`
- URL: `https://api.bunny.net/dnszone/{zoneId}/records/{id}`
- Auth: API key in header `AccessKey`
- TypeScript: <https://skmtc.dev/bunny/apis/bunny-net-api/docs/dnszone/:zoneId/records/:id/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `zoneId` integer, required
- `id` integer, required

## Request body

- UpdateDnsRecordModel
  - `Type` 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15: 0 = A 1 = AAAA 2 = CNAME 3 = TXT 4 = MX 5 = Redirect 6 = Flatten 7 = Pull Zone 8 = SRV 9 = CAA 10 = PTR 11 = Script 12 = NS 13 = SVCB 14 = HTTPS 15 = TLSA
  - `Ttl` integer, nullable
  - `Value` string, nullable
  - `Name` string, nullable
  - `Weight` integer, nullable
  - `Priority` integer, nullable
  - `Flags` integer, nullable
  - `Tag` string, nullable
  - `Port` integer, nullable
  - `PullZoneId` integer, nullable
  - `ScriptId` integer, nullable
  - `Accelerated` boolean, nullable
  - `MonitorType` 0 | 1 | 2 | 3: 0 = None 1 = Ping 2 = HTTP 3 = Monitor
  - `GeolocationLatitude` number, double, nullable
  - `GeolocationLongitude` number, double, nullable
  - `LatencyZone` string, nullable
  - `SmartRoutingType` 0 | 1 | 2: 0 = None 1 = Latency 2 = Geolocation
  - `Disabled` boolean, nullable
  - `EnviromentalVariables` DnsRecordEnviromentalVariableModel[], nullable
    - `Name` string, nullable
    - `Value` string, nullable
  - `Comment` string, nullable
  - `AutoSslIssuance` boolean, nullable
  - `Id` integer

## Response `204`

The DNS record was successfully updated.

## Other responses

- `400`: Failed updating the DNS record. Model validation failed.
- `401`: The request authorization failed
- `404`: The DNS Zone or DNS Record with the requested ID does not exist.
- `500`: Internal Server Error

---

[API](https://skmtc.dev/bunny/apis/bunny-net-api.md) - [All operations](https://skmtc.dev/bunny/apis/bunny-net-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bunny/apis/bunny-net-api/revisions/2b06f94dbfbf?raw)
