---
title: "Create a New Domain"
method: POST
path: "/v2/domains"
tags: ["DigitalOcean-public.v2-new_Domains"]
---

# Create a New Domain

`POST /v2/domains`

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.

## Request body

- Domain
  - `name` string — 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.
  - `ip_address` string — This optional attribute may contain an IP address. When provided, an A record will be automatically created pointing to the apex domain.
  - `ttl` integer, nullable — This 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_file` string, nullable — This 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.

## Response `201`

The response will be a JSON object with a key called `domain`. The value of this will be an object that contains the standard attributes associated with a domain.

- object
  - `domain` Domain
    - `name` string — 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.
    - `ip_address` string — This optional attribute may contain an IP address. When provided, an A record will be automatically created pointing to the apex domain.
    - `ttl` integer, nullable — This 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_file` string, nullable — This 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.

## Other responses

- `401` — Authentication failed due to invalid credentials.
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/revisions/cb3bf9b21459/schema)
