> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/zdns/private-zone-record/modifyprivatezonerecord.md).

# ModifyPrivateZoneRecord

## 1. API Description

This API (ModifyPrivateZoneRecord) is used to modify a specified DNS record of a DNS Zone.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type    | Description                                                                                                                                              |
| -------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| zoneId         | Yes      | String  | <p>DNS Zone ID.</p><p>It can be obtained by calling <a href="/api-reference/zdns/private-zone/describeprivatezones.md">DescribePrivateZones</a>.</p>     |
| recordId       | Yes      | String  | ID of the DNS record to be modified.                                                                                                                     |
| value          | Yes      | String  | DNS record value.                                                                                                                                        |
| weight         | No       | Integer | <p>DNS record weight.</p><p>Only A or AAAA supported.</p><p>Value range: \[1, 100]</p><p>Default value: 1</p>                                            |
| ttl            | No       | Integer | <p>Domain local cache time.</p><p>Unit: seconds.</p><p>Valid values: 5-86400 (up to one day).</p><p>Value range: \[5, 86400]</p><p>Default value: 60</p> |
| priority       | No       | Integer | <p>Priority of the MX record.</p><p>A smaller value indicates a higher priority.</p><p>Default value: 1.</p><p>Value range: \[1, 99]</p>                 |
| remark         | No       | String  | <p>Note information.</p><p>The length is up to 255 characters.</p>                                                                                       |

## 3. Output Parameters

| Parameter Name | Type   | Description                                                                                                           |
| -------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Modify the DNS record of a DNS Zone.**

```json
POST /api/v2/zdns HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyPrivateZoneRecord
<Common Request Params>

Request：
{
  "zoneId": "<zoneId>",
  "recordId": "<recordId>",
  "value": "test.com",
  "weight": 100,
  "ttl": 10,
  "remark": "Test"
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                                 | Description                    |
| ---------------- | ------------------------------------------ | ------------------------------ |
| 404              | INVALID\_PRIVATE\_ZONE\_RECORD\_NOT\_FOUND | The DNS record does not exist. |
| 400              | INVALID\_RECORD\_VALUE                     | Invalid record value.          |
| 409              | INVALID\_RECORD\_VALUE\_CONFLICT           | Record value conflict.         |
