pydo.domains.create()
Generated on 3 Aug 2026
from pydo version
v0.40.0
Usage
client.domains.create(
body={
"name": "example.com",
"ip_address": "192.0.2.1",
},
)Description
To create a new domain, send a POST request to /v2/domains. Set the “name”
attribute to the domain name you are adding. Optionally, you may set the
“ip_address” attribute, and an A record will be automatically created pointing
to the apex domain.
Parameters
namestring optionalExample:
example.comThe name of the domain itself. This should follow the standard domain format of domain.TLD. For instance,
example.comis a valid domain name.ip_addressstring optionalExample:
192.0.2.1This optional attribute may contain an IP address. When provided, an A record will be automatically created pointing to the apex domain.
ttlinteger or null optional read-onlyExample:
1800This value is the time to live for the records on this domain, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
zone_filestring or null optional read-onlyExample:
$ORIGIN example.com. $TTL 1800 example.com. IN SOA ns1.digitalocean.com. hostmaster.example.com. 1415982609 10800 3600 604800 1800 example.com. 1800 IN NS ns1.digitalocean.com. example.com. 1800 IN NS ns2.digitalocean.com. example.com. 1800 IN NS ns3.digitalocean.com. example.com. 1800 IN A 1.2.3.4This attribute contains the complete contents of the zone file for the selected domain. Individual domain record resources should be used to get more granular control over records. However, this attribute can also be used to get information about the SOA record, which is created automatically and is not accessible as an individual record resource.
Request Sample
Response Example
More Information
See /v2/domains in the API reference for additional detail on responses, headers, parameters, and more.