Domain record resources are used to set or retrieve information about the individual DNS records configured for a domain.
This allows you to build and manage DNS zone files by adding and modifying individual records for a domain.
View the API documentation at https://docs.digitalocean.com/reference/api/api-reference/#tag/Domain-Records.
Parameter | Choices | Default | Comments |
---|---|---|---|
client_override_options (dict) |
Client override options (developer use). For example, can be used to override the DigitalOcean API endpoint for an internal test suite. If provided, these options will knock out existing options. | ||
data (str) |
Variable 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. | ||
domain_name (str) |
The domain name. | ||
flags (int) |
An unsigned integer between 0-255 used for CAA records. | ||
module_override_options (dict) |
Module override options (developer use). Can be used to override module options to support experimental or future options. If provided, these options will knock out existing options. | ||
name (str) |
The host name, alias, or service being defined by the record. | ||
port (int) |
The port for SRV records. | ||
priority (int) |
The priority for SRV and MX records. | ||
state (str) |
|
present | State of the resource, present to create, absent to destroy. |
tag (str) |
|
The parameter tag for CAA records. | |
timeout (int) |
300 | Polling timeout in seconds. | |
token (str) |
DigitalOcean API token. There are several environment variables which can be used to provide this value. DIGITALOCEAN_ACCESS_TOKEN , DIGITALOCEAN_TOKEN , DO_API_TOKEN , DO_API_KEY , DO_OAUTH_TOKEN and OAUTH_TOKEN |
||
ttl (int) |
This 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 kshould be requested. | ||
type (str) |
|
The type of the DNS record. | |
weight (int) |
The weight for SRV records. |
- name: Create domain A record
digitalocean.cloud.domain_record:
token: "{{ token }}"
domain_name: example.com
type: A
name: www
data: 192.168.100.50
Key | Returned | Description |
---|---|---|
domain_record (dict) |
always |
Domain record.
Sample:
|
error (dict) |
failure |
DigitalOcean API error.
Sample:
|
msg (str) |
always |
Domain record result information.
Sample:
|