dots.v2.domains.byDomain_name().records.post()
Generated on 27 Oct 2026
from DoTs version
v1.21.0
Usage
client.v2.domains.byDomain_name(domain_name).records.post(body: Domain_record_aaaa | Domain_record_a | Domain_record_caa | Domain_record_cname | Domain_record_mx | Domain_record_ns | Domain_record_soa | Domain_record_srv | Domain_record_txt, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | RecordsPostResponse>Description
To create a new record to a domain, send a POST request to
/v2/domains/{domain_name}/records.
The request must include all of the required fields for the domain record type being added.
See the attribute table for details regarding record types and their respective required attributes.
Parameters
Path Parameters
domain_namestring requiredExample:
example.comThe name of the domain itself.
Request Body
domain_record_a
idinteger optional read-onlyExample:
28448429A unique identifier for each domain record.
typestring requiredExample:
NSThe type of the DNS record. For example: A, CNAME, TXT, ...
namestring requiredExample:
@The host name, alias, or service being defined by the record.
datastring requiredExample:
ns1.digitalocean.comVariable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
priorityinteger or null optionalThe priority for SRV and MX records.
portinteger or null optionalThe port for SRV records.
ttlinteger optionalExample:
1800This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
weightinteger or null optionalThe weight for SRV records.
flagsinteger or null optionalAn unsigned integer between 0-255 used for CAA records.
tagstring or null optionalThe parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"
domain_record_aaaa
idinteger optional read-onlyExample:
28448429A unique identifier for each domain record.
typestring requiredExample:
NSThe type of the DNS record. For example: A, CNAME, TXT, ...
namestring requiredExample:
@The host name, alias, or service being defined by the record.
datastring requiredExample:
ns1.digitalocean.comVariable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
priorityinteger or null optionalThe priority for SRV and MX records.
portinteger or null optionalThe port for SRV records.
ttlinteger optionalExample:
1800This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
weightinteger or null optionalThe weight for SRV records.
flagsinteger or null optionalAn unsigned integer between 0-255 used for CAA records.
tagstring or null optionalThe parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"
domain_record_caa
idinteger optional read-onlyExample:
28448429A unique identifier for each domain record.
typestring requiredExample:
NSThe type of the DNS record. For example: A, CNAME, TXT, ...
namestring requiredExample:
@The host name, alias, or service being defined by the record.
datastring requiredExample:
ns1.digitalocean.comVariable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
priorityinteger or null optionalThe priority for SRV and MX records.
portinteger or null optionalThe port for SRV records.
ttlinteger optionalExample:
1800This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
weightinteger or null optionalThe weight for SRV records.
flagsinteger or null requiredAn unsigned integer between 0-255 used for CAA records.
tagstring or null requiredThe parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"
domain_record_cname
idinteger optional read-onlyExample:
28448429A unique identifier for each domain record.
typestring requiredExample:
NSThe type of the DNS record. For example: A, CNAME, TXT, ...
namestring requiredExample:
@The host name, alias, or service being defined by the record.
datastring requiredExample:
ns1.digitalocean.comVariable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
priorityinteger or null optionalThe priority for SRV and MX records.
portinteger or null optionalThe port for SRV records.
ttlinteger optionalExample:
1800This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
weightinteger or null optionalThe weight for SRV records.
flagsinteger or null optionalAn unsigned integer between 0-255 used for CAA records.
tagstring or null optionalThe parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"
domain_record_mx
idinteger optional read-onlyExample:
28448429A unique identifier for each domain record.
typestring requiredExample:
NSThe type of the DNS record. For example: A, CNAME, TXT, ...
namestring optionalExample:
@The host name, alias, or service being defined by the record.
datastring requiredExample:
ns1.digitalocean.comVariable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
priorityinteger or null requiredThe priority for SRV and MX records.
portinteger or null optionalThe port for SRV records.
ttlinteger optionalExample:
1800This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
weightinteger or null optionalThe weight for SRV records.
flagsinteger or null optionalAn unsigned integer between 0-255 used for CAA records.
tagstring or null optionalThe parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"
domain_record_ns
idinteger optional read-onlyExample:
28448429A unique identifier for each domain record.
typestring requiredExample:
NSThe type of the DNS record. For example: A, CNAME, TXT, ...
namestring requiredExample:
@The host name, alias, or service being defined by the record.
datastring requiredExample:
ns1.digitalocean.comVariable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
priorityinteger or null optionalThe priority for SRV and MX records.
portinteger or null optionalThe port for SRV records.
ttlinteger optionalExample:
1800This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
weightinteger or null optionalThe weight for SRV records.
flagsinteger or null requiredAn unsigned integer between 0-255 used for CAA records.
tagstring or null requiredThe parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"
domain_record_soa
idinteger optional read-onlyExample:
28448429A unique identifier for each domain record.
typestring requiredExample:
NSThe type of the DNS record. For example: A, CNAME, TXT, ...
namestring optionalExample:
@The host name, alias, or service being defined by the record.
datastring optionalExample:
ns1.digitalocean.comVariable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
priorityinteger or null optionalThe priority for SRV and MX records.
portinteger or null optionalThe port for SRV records.
ttlinteger requiredExample:
1800This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
weightinteger or null optionalThe weight for SRV records.
flagsinteger or null optionalAn unsigned integer between 0-255 used for CAA records.
tagstring or null optionalThe parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"
domain_record_srv
idinteger optional read-onlyExample:
28448429A unique identifier for each domain record.
typestring requiredExample:
NSThe type of the DNS record. For example: A, CNAME, TXT, ...
namestring requiredExample:
@The host name, alias, or service being defined by the record.
datastring requiredExample:
ns1.digitalocean.comVariable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
priorityinteger or null requiredThe priority for SRV and MX records.
portinteger or null requiredThe port for SRV records.
ttlinteger optionalExample:
1800This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
weightinteger or null optionalThe weight for SRV records.
flagsinteger or null requiredAn unsigned integer between 0-255 used for CAA records.
tagstring or null requiredThe parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"
domain_record_txt
idinteger optional read-onlyExample:
28448429A unique identifier for each domain record.
typestring requiredExample:
NSThe type of the DNS record. For example: A, CNAME, TXT, ...
namestring requiredExample:
@The host name, alias, or service being defined by the record.
datastring requiredExample:
ns1.digitalocean.comVariable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
priorityinteger or null optionalThe priority for SRV and MX records.
portinteger or null optionalThe port for SRV records.
ttlinteger optionalExample:
1800This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
weightinteger or null optionalThe weight for SRV records.
flagsinteger or null requiredAn unsigned integer between 0-255 used for CAA records.
tagstring or null requiredThe parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"
Request Sample
Response Example
More Information
See /v2/domains/{domain_name}/records in the API reference for additional detail on responses, headers, parameters, and more.