API Documents
Contents
    Loading
Documentation API Documents Update a Record

Update a Record

1. API Description

This API (Record.Modify) is used to Update a Record.
Domain name for API request:https://api.dnspod.com/Record.Modify
HTTP request method: POST

2. Request Parameters

The table below lists only the API request parameters. Common request parameters are required when the API is called. For more information, please see Common Request Parameters.

Parameter Required Description
domain_id yes The domain id. Mandatory parameter.
record_id yes The record id. Mandatory parameter.
sub_domain no The record name like “www”.The default value is “@”.Optional parameter
record_type yes The record type.You can get the list from the API.All capital letters like “A”. Mandatory parameter.
record_line yes The record line.You can get the list from the API.The default value is “default”, such as “default”, “AD”, “AE”. Mandatory parameter.
value no The record value.For example: IP:200.200.200.200, CNAME: cname.dnspod.com., MX: mail.dnspod.com. Mandatory parameter.
mx {1-20} yes This only need to and must be set when record_type is “MX”.Range from 1 to 20.
ttl {1-604800} yes TTL,range from 1 to 604800.Every grade has its own min value.Optional parameter.

3. Response Codes

Only the response codes related to this API are listed below. For other response codes, please see Common Return Codes.

Response Code Description
-15 Domain got prohibited.
-7 A domain of a company account need a upgrade first.
-8 You need a upgrade for the domain you are acting for.
6 Invalid domain id.
7 You don’t have the permission.
8 Invalid record id.
21 Domain got locked.
22 Invalid sub domain.
23 The number of the record level is up to limit.
24 Invalid sub domain for general analysis.
25 The number of poll is up to limit.
26 Invalid record line.
27 Invalid record type.
29 TTL is too small.
30 Invalid MX value.
31 The number of URL records is up to limit.
32 The number of NS records is up to limit.
33 The number of AAAA records is up to limit.
34 Invalid record value.
35 The IP is not allowed.
36 When the sub_domain is “@” and the record_type is “NS”,the record_line can only be “default”.

4. Sample

curl -X POST https://api.dnspod.com/Record.Modify -d 'login_token=730060,e1a8a$f14dc5dcbafd83680b3d2a553c4d553d&format=json&domain_id=2317346&record_id=16894439&sub_domain=www&value=3.2.2.2&record_type=A&record_line=default'

The following is a sample response:

  • JSON:
{
    "status": {
        "code":"1",
        "message":"Action completed successful",
        "created_at":"2012-11-24 16:53:23"
    },
    "record": {
        "id":16894439,
        "name":"@",
        "value":"3.2.2.2","status":"enable"
    }
}
Last updated on 2022-03-11 02:59

DNS health check tool powered by DNSPod

查询域名信息,快速排查网站问题

Official WeChat group

Join WeChat group to chat and feedback

Scan using WeChat