Edit a DNS record
This request is used for editing a DNS record for the domain.
The DNS record can be specified using the ID.
Request syntax
The request should be sent over the HTTPS protocol using the POST method.
POST /api2/admin/dns/edit
Host: pddimp.yandex.ru
PddToken: <PDD token>
...
domain=<domain name>
&record_id=<record ID>
[&admin_mail=<administrator's email address>]
[&content=<record contents>]
[&priority=<record priority>]
[&weight=<SRV record weight>]
[&port=<host port>]
[&target=<host's canonical name>]
[&subdomain=<subdomain name>]
[&ttl=<lifespan of record>]
[&refresh=<time between updates>]
[&retry=<time between attempts to get record>]
[&expire=<time limit>]
[&neg_cache=<caching time>]
Headers:
Parameters:
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
record_id | Integer | ID of the DNS record. |
Optional | ||
subdomain | String | Subdomain name. For example, “domain.com” is the name of a subdomain of the “com” domain, and “my.domain.com” is a subdomain of the “domain.com” domain. The default value is “@” (the domain root). This parameter should be passed if you need to create or modify the DNS record for a subdomain, and not for the domain. |
ttl | Integer | Lifetime of the DNS record, in seconds. For SOA records, this is how long the DNS record's value is cached by intermediary DNS servers. This length of time will also be used by default for all other new records in the zone. Acceptable values are from 900 to 1209600. The recommended value is 21600. |
refresh | Integer | The frequency in seconds for secondary DNS servers to check DNS records for this zone. Acceptable values are from 900 to 86400. The recommended value is 10800. This parameter must be passed if an SOA record is being edited. |
retry | Integer | The time in seconds between repeated attempts by secondary DNS servers to get the zone records. Repeat requests are sent if the primary server does not respond. Acceptable values are from 90 to 3600. The recommended value is 900. This parameter must be passed if an SOA record is being edited. |
expire | Integer | The time in seconds after which secondary DNS servers consider the zone records nonexistent if the primary server does not respond. Acceptable values are from 90 to 3600. The recommended value is 900. This parameter must be passed if an SOA record is being edited. |
neg_cache | Integer | The time in seconds during which a negative response from the DNS server (ERROR = NXDOMAIN) will be cached. Acceptable values are from 90 to 86400. The recommended value is 10800. This parameter must be passed if an SOA record is being edited. |
admin_mail | String | The email address of the domain administrator. This parameter is required only for SOA records. |
content | String | Contents of the DNS record. For records of the type:
|
priority | Integer | Priority of the DNS record (the smaller the value, the higher its priority). This parameter is required only for SRV and MX records. The default value is 10. |
port | String | The TCP or UDP port of the host where the service resides. The service may be, for example, jabber. This parameter is required only for SRV records. |
weight | Integer | The weight of the SRV record in relation to other SRV records for the same domain and with the same priority. This parameter is required only for SRV records. |
target | String | The canonical name of the host providing the service. This parameter is required only for SRV records. |
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
record_id | Integer | ID of the DNS record. |
Optional | ||
subdomain | String | Subdomain name. For example, “domain.com” is the name of a subdomain of the “com” domain, and “my.domain.com” is a subdomain of the “domain.com” domain. The default value is “@” (the domain root). This parameter should be passed if you need to create or modify the DNS record for a subdomain, and not for the domain. |
ttl | Integer | Lifetime of the DNS record, in seconds. For SOA records, this is how long the DNS record's value is cached by intermediary DNS servers. This length of time will also be used by default for all other new records in the zone. Acceptable values are from 900 to 1209600. The recommended value is 21600. |
refresh | Integer | The frequency in seconds for secondary DNS servers to check DNS records for this zone. Acceptable values are from 900 to 86400. The recommended value is 10800. This parameter must be passed if an SOA record is being edited. |
retry | Integer | The time in seconds between repeated attempts by secondary DNS servers to get the zone records. Repeat requests are sent if the primary server does not respond. Acceptable values are from 90 to 3600. The recommended value is 900. This parameter must be passed if an SOA record is being edited. |
expire | Integer | The time in seconds after which secondary DNS servers consider the zone records nonexistent if the primary server does not respond. Acceptable values are from 90 to 3600. The recommended value is 900. This parameter must be passed if an SOA record is being edited. |
neg_cache | Integer | The time in seconds during which a negative response from the DNS server (ERROR = NXDOMAIN) will be cached. Acceptable values are from 90 to 86400. The recommended value is 10800. This parameter must be passed if an SOA record is being edited. |
admin_mail | String | The email address of the domain administrator. This parameter is required only for SOA records. |
content | String | Contents of the DNS record. For records of the type:
|
priority | Integer | Priority of the DNS record (the smaller the value, the higher its priority). This parameter is required only for SRV and MX records. The default value is 10. |
port | String | The TCP or UDP port of the host where the service resides. The service may be, for example, jabber. This parameter is required only for SRV records. |
weight | Integer | The weight of the SRV record in relation to other SRV records for the same domain and with the same priority. This parameter is required only for SRV records. |
target | String | The canonical name of the host providing the service. This parameter is required only for SRV records. |
POST /api2/registrar/dns/edit
Host: pddimp.yandex.ru
PddToken: <PDD token>
Authorization: OAuth <OAuth token>
...
domain=<domain name>
&record_id=<record ID>
[&admin_mail=<administrator's email adress>]
[&content=<record contents>]
[&priority=<record priority>]
[&weight=<SRV record weight>]
[&port=<host port>]
[&target=<host's canonical name>]
[&subdomain=<subdomain name>]
[&ttl=<lifespan of record>]
[&refresh=<time between updates>]
[&retry=<time between attempts to get records>]
[&expire=<time limit>]
[&neg_cache=<caching time>]
Headers:
Name | Description |
---|---|
PddToken | |
Authorization |
Name | Description |
---|---|
PddToken | |
Authorization |
Parameters:
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
record_id | Integer | ID of the DNS record. |
Optional | ||
subdomain | String | Subdomain name. For example, “domain.com” is the name of a subdomain of the “com” domain, and “my.domain.com” is a subdomain of the “domain.com” domain. The default value is “@” (the domain root). This parameter should be passed if you need to create or modify the DNS record for a subdomain, and not for the domain. |
ttl | Integer | Lifetime of the DNS record, in seconds. For SOA records, this is how long the DNS record's value is cached by intermediary DNS servers. This length of time will also be used by default for all other new records in the zone. Acceptable values are from 900 to 1209600. The recommended value is 21600. |
refresh | Integer | The frequency in seconds for secondary DNS servers to check DNS records for this zone. Acceptable values are from 900 to 86400. The recommended value is 10800. This parameter must be passed if an SOA record is being edited. |
retry | Integer | The time in seconds between repeated attempts by secondary DNS servers to get the zone records, if the primary server did not return a response. Acceptable values are from 90 to 3600. The recommended value is 900. This parameter must be passed if an SOA record is being edited. |
expire | Integer | The time in seconds after which secondary DNS servers consider the zone records nonexistent if the primary server repeatedly does not respond. Acceptable values are from 90 to 3600. The recommended value is 900. This parameter must be passed if an SOA record is being edited. |
neg_cache | Integer | The time in seconds during which a negative response from the DNS server (ERROR = NXDOMAIN) will be cached. Acceptable values are from 90 to 86400. The recommended value is 10800. This parameter must be passed if an SOA record is being edited. |
admin_mail | String | The email address of the domain administrator. This parameter is required only for SOA records. |
content | String | Contents of the DNS record. For records of the type:
|
priority | Integer | Priority of the DNS record (the smaller the value, the higher its priority). This parameter is required only for SRV and MX records. The default value is 10. |
port | String | The TCP or UDP port of the host where the service resides. The service may be, for example, jabber. This parameter is required only for SRV records. |
weight | Integer | The weight of the SRV record in relation to other SRV records for the same domain and with the same priority. This parameter is required only for SRV records. |
target | String | The canonical name of the host providing the service. This parameter is required only for SRV records. |
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
record_id | Integer | ID of the DNS record. |
Optional | ||
subdomain | String | Subdomain name. For example, “domain.com” is the name of a subdomain of the “com” domain, and “my.domain.com” is a subdomain of the “domain.com” domain. The default value is “@” (the domain root). This parameter should be passed if you need to create or modify the DNS record for a subdomain, and not for the domain. |
ttl | Integer | Lifetime of the DNS record, in seconds. For SOA records, this is how long the DNS record's value is cached by intermediary DNS servers. This length of time will also be used by default for all other new records in the zone. Acceptable values are from 900 to 1209600. The recommended value is 21600. |
refresh | Integer | The frequency in seconds for secondary DNS servers to check DNS records for this zone. Acceptable values are from 900 to 86400. The recommended value is 10800. This parameter must be passed if an SOA record is being edited. |
retry | Integer | The time in seconds between repeated attempts by secondary DNS servers to get the zone records, if the primary server did not return a response. Acceptable values are from 90 to 3600. The recommended value is 900. This parameter must be passed if an SOA record is being edited. |
expire | Integer | The time in seconds after which secondary DNS servers consider the zone records nonexistent if the primary server repeatedly does not respond. Acceptable values are from 90 to 3600. The recommended value is 900. This parameter must be passed if an SOA record is being edited. |
neg_cache | Integer | The time in seconds during which a negative response from the DNS server (ERROR = NXDOMAIN) will be cached. Acceptable values are from 90 to 86400. The recommended value is 10800. This parameter must be passed if an SOA record is being edited. |
admin_mail | String | The email address of the domain administrator. This parameter is required only for SOA records. |
content | String | Contents of the DNS record. For records of the type:
|
priority | Integer | Priority of the DNS record (the smaller the value, the higher its priority). This parameter is required only for SRV and MX records. The default value is 10. |
port | String | The TCP or UDP port of the host where the service resides. The service may be, for example, jabber. This parameter is required only for SRV records. |
weight | Integer | The weight of the SRV record in relation to other SRV records for the same domain and with the same priority. This parameter is required only for SRV records. |
target | String | The canonical name of the host providing the service. This parameter is required only for SRV records. |
Request example
POST /api2/admin/dns/edit HTTP/1.1
Host: pddimp.yandex.ru
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
...
domain=domain.com&record_id=1&subdomain=www&ttl=14400&content=127.0.0.1
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' -d 'domain=domain.com&record_id=1&subdomain=www&ttl=14400&content=127.0.0.1' 'https://pddimp.yandex.ru/api2/admin/dns/edit'
POST /api2/admin/dns/edit HTTP/1.1
Host: pddimp.yandex.ru
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
Authorization: OAuth 00123456789ABCDEF00000000000000000000000000000000000
...
domain=domain.com&record_id=1&subdomain=www&ttl=14400&content=127.0.0.1
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' -H 'Authorization: OAuth 00123456789ABCDEF00000000000000000000000000000000000' -d 'domain=domain.com&record_id=1&subdomain=www&ttl=14400&content=127.0.0.1' 'https://pddimp.yandex.ru/api2/admin/dns/edit'
Response structure
{
"domain": "{domain name}",
"record_id": "{record ID}",
"record":
{
"record_id": "{record ID}",
"type": "{record type}",
"domain": "{domain name}"
"fqdn": {"absolute domain name"},
"ttl": "{record lifetime}",
"subdomain": "{subdomain name}",
"content": "{record contents}",
"priority": "{record priority}",
"operation": "{editing}"
},
"success": "{status of request execution}"
}
Name | Type of value | Description |
---|---|---|
domain | String | Name of the domain. |
record | Object | Information about the DNS record. |
success | String | Status of request execution. Possible values:
|
error | String | Error code. Included in the response if the request resulted in an error. Possible values:
|
Keys for the record object | ||
record_id | Integer | ID of the DNS record. |
type | String | Type of DNS record. Possible values:
|
domain | String | Name of the domain. |
fqdn | String | Absolute domain name (FQDN). |
ttl | Integer | Lifetime of the DNS record, in seconds. |
subdomain | String | Subdomain name. For example, “my.domain.com” is the name of a subdomain of the “domain.com” domain. You can use “my” in place of “my.domain.com”. |
content | String | Contents of the DNS record. |
priority | Integer | Priority of the DNS record. Exists for MX and SRV records. For all other DNS records, an empty string is returned. |
operation | String | The current operation being performed with the DNS record. Only the |
Name | Type of value | Description |
---|---|---|
domain | String | Name of the domain. |
record | Object | Information about the DNS record. |
success | String | Status of request execution. Possible values:
|
error | String | Error code. Included in the response if the request resulted in an error. Possible values:
|
Keys for the record object | ||
record_id | Integer | ID of the DNS record. |
type | String | Type of DNS record. Possible values:
|
domain | String | Name of the domain. |
fqdn | String | Absolute domain name (FQDN). |
ttl | Integer | Lifetime of the DNS record, in seconds. |
subdomain | String | Subdomain name. For example, “my.domain.com” is the name of a subdomain of the “domain.com” domain. You can use “my” in place of “my.domain.com”. |
content | String | Contents of the DNS record. |
priority | Integer | Priority of the DNS record. Exists for MX and SRV records. For all other DNS records, an empty string is returned. |
operation | String | The current operation being performed with the DNS record. Only the |