domain
Generated on 13 Feb 2026
from digitalocean.cloud version
v1.2.1
Synopsis
Domain resources are domain names that you have purchased from a domain name registrar that
you are managing through the DigitalOcean DNS interface.
This module establishes top-level control over each domain. Actions that affect individual domain records should be taken on the domain_record module. View the API documentation at https://docs.digitalocean.com/reference/api/api-reference/#tag/Domains.
Requirements
- pydo >= 0.1.3
- azure-core >= 1.26.1
Parameters
| Parameter | Choices / Default | Description |
|---|---|---|
client_override_optionsdict |
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. | |
ip_addressstr |
This optional attribute may contain an IP address. When provided, an A record will be automatically created pointing to the apex domain. | |
module_override_optionsdict |
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. | |
namestr / required |
The name of the domain itself. This should follow the standard domain format of domain.TLD. For instance, example.com is a valid domain name. |
|
statestr |
Choices:
|
State of the resource, present to create, absent to destroy. |
timeoutint |
Default: 300 |
Polling timeout in seconds. |
tokenstr |
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 |
Examples
- name: Create domain
digitalocean.cloud.domain:
token: "{{ token }}"
name: my-test-domain.com
- name: Create domain and apex record
digitalocean.cloud.domain:
token: "{{ token }}"
name: my-test-domain.com
ip_address: 192.168.100.50Return Values
| Key | Returned | Description |
|---|---|---|
domaindict |
always | Domain. Sample: |
errordict |
failure | DigitalOcean API error. Sample: |
msgstr |
always | Domain result information. Sample: |