Add a DNS record
This request is used for adding a DNS record for the domain.
Request syntax
The request should be sent over the HTTPS protocol using the POST method.
POST /api2/admin/dns/add
Host: pddimp.yandex.ru
PddToken: <PDD token>
...
domain=<domain name>
&type=<record type>
[&admin_mail=<administrator's email address>]
[&content=<ip or domain name>]
[&priority=<record priority>]
[&weight=<SRV record weight>]
[&port=<host port>]
[&target=<host's canonical name>]
[&subdomain=<subdomain name>]
[&ttl=<lifespan of record>]
Headers:
Parameters:
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
type | String | Type of DNS record. Possible values:
|
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. |
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. |
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. |
target | String | The canonical name of the host providing the service. This parameter is required only for SRV records. |
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. The default value is 21600. |
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
type | String | Type of DNS record. Possible values:
|
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. |
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. |
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. |
target | String | The canonical name of the host providing the service. This parameter is required only for SRV records. |
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. The default value is 21600. |
POST /api2/registrar/dns/add
Host: pddimp.yandex.ru
PddToken: <PDD token>
Authorization: OAuth <OAuth token>
...
domain=<domain name>
&type=<record type>
[&admin_mail=<administrator's email address>]
[&content=<ip or domain name>]
[&priority=<record priority>]
[&weight=<SRV record weight>]
[&port=<host port>]
[&target=<host's canonical name>]
[&subdomain=<subdomain name>]
[&ttl=<record lifespan>]
Headers:
Name | Description |
---|---|
PddToken | |
Authorization |
Name | Description |
---|---|
PddToken | |
Authorization |
Parameters:
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
type | String | Type of DNS record. Possible values:
|
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. |
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. |
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. |
target | String | The canonical name of the host providing the service. This parameter is required only for SRV records. |
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. The default value is 21600. |
Parameter | Type | Value |
---|---|---|
Mandatory | ||
domain | String | Name of the domain. |
type | String | Type of DNS record. Possible values:
|
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. |
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. |
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. |
target | String | The canonical name of the host providing the service. This parameter is required only for SRV records. |
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. The default value is 21600. |
Request example
POST /api2/admin/dns/add HTTP/1.1
Host: pddimp.yandex.ru
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
...
domain=domain.com&type=A&subdomain=www&ttl=14400&content=127.0.0.1
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' -d 'domain=domain.com&type=A&subdomain=www&ttl=14400&content=127.0.0.1' 'https://pddimp.yandex.ru/api2/admin/dns/add'soa
POST /api2/admin/dns/add HTTP/1.1
Host: pddimp.yandex.ru
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
Authorization: OAuth 00123456789ABCDEF00000000000000000000000000000000000
...
domain=domain.com&type=A&subdomain=www&ttl=14400&content=127.0.0.1
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' -H 'Authorization: OAuth 00123456789ABCDEF00000000000000000000000000000000000' -d 'domain=domain.com&type=A&subdomain=www&ttl=14400&content=127.0.0.1' 'https://pddimp.yandex.ru/api2/admin/dns/add'soa
Response structure
{
"domain": "{domain name}",
"record":
{
"record_id": "{record ID}",
"type": "{type of record}",
"domain": "{domain name}",
"subdomain": "{subdomain name}",
"fqdn": "{absolute domain name}",
"content": "{record contents}",
"ttl": "{record lifetime}",
"priority": "{record priority}"
},
"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. |
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. |