Adding a DNS record for a domain¶
Note
To add a DNS record, a domain must already have been created.
Note
If the optional attributes are not set, the system adds a default value.
Note
The user can set the load balancing settings together with the creation of a DNS record. To do so, add the object UpstreamOptionsVO under upstreamOptions.
Note
The body does not contain the attributes id, created, and modified. The system sets the values of these attributes after the entry is created.
Note
The attribute sslCertTemplate is optional and must be set to use an SSL/TLS certificate. If no SSL/TLS certificate is required, omit the attribute in the body.
Sends a POST request to the endpoint /domain/{domainId}/dns-records.
Description¶
The Add-DNS-Record request allows the user to add one or more DNS records for a domain of the organisation.
Requirements¶
Values of the request: Domain ID {domainId}
Objects: DnsRecordVO
Request¶
To add DNS records for a domain, the Domain-ID {domainId} needs to be added to the path of the request.
For a detailed specification of which information is required to add a DNS record, one or more objects DnsRecordVO with the following attributes need to be defined in the body:
| Attributes | Description | Values |
|---|---|---|
name |
The name of the subdomain of the DNS record. Usually corresponds to the name of the domain or subdomain for which the DNS record is defined. | string |
value |
The values in the format of an IP address, name, or text for the DNS entry. |
|
ttl |
The time to live in seconds. |
|
recordType |
The value to identify the type of a DNS record. |
|
The following attributes are optional:
| Attributes | Description | Values |
|---|---|---|
priority |
The priority of an MX record. | integer |
vhostId |
The ID of the subdomain to which the DNS entry is assigned. | integer |
weight |
The weight of the SRV record. | integer |
port |
The server port on the SRV record. | integer |
active |
Define whether the domain or subdomain should be protected by Myra or not. |
|
sslCertTemplate |
|
|
upstreamOptions |
An array with one or more objects UpstreamOptionsVO with information about the load balancing settings. |
UpstreamOptionsVO |
alternativeCname |
The alternative CNAME that points to the DNS record. | string |
caaFlags |
The default value is 0. If it is set to 1, validation is blocked when the tag of the CA is unknown. | string |
caaTag |
Shows one of the following options:
|
string |
endpoints |
The public Myra IPv4 address and IPv6 address for the DNS record. | array |
serviceType |
The type of the service behind the DNS record. |
|
enabled |
The availability of the entry. |
|
comment |
An individual comment for the entry. | string |
The system responds by returning the object DnsRecordVO with the information about the new entry.
Example¶
Example request body:
{
"objectType": "string",
"name": "string",
"value": "string",
"priority": 0,
"ttl": 0,
"vhostId": 0,
"recordType": "string",
"weight": 0,
"port": 0,
"active": true,
"paused": true,
"sslCertTemplate": "string",
"upstreamOptions": "string",
"alternativeCname": "string",
"environment": "string",
"caaFlags": 0,
"caaTag": "string",
"endpoints": "string",
"serviceType": 0,
"encryption": "string",
"identificationNumber": "string",
"hashType": "string",
"enabled": true,
"comment": "string"
}
Responses¶
The following responses are available:
| STATUS CODE | DESCRIPTION |
|---|---|
| 201 | The request has succeeded and a new object has been created. |
| 400 | The request was unsuccessful. The request was invalid or information is missing. |
| 401 | The request has not succeeded because the user authentication was incorrect. |
| 403 | The request has not succeeded because the user does not have the right permissions. |