# Domains quickstart

> Platform versions: this page applies to API v3.x only, not to API v4.x.
> Equivalent page for API v4.x: [Workloads](/en/documentation/platform/workloads.md)
> Release stage: Deprecated.

This guide instructs you through creating your first domain in [Domains](/en/documentation/platform/domains/). By the end you will have a domain that serves the hostnames you list and passes their requests to your application.

A **domain** is an entry on your account: a name, the hostnames it serves, the application that answers them, and the certificate it uses. Azion generates an Azion domain for it in the format `xxxx.map.azionedge.net`. The name identifies the entry and is not a hostname.

---

## Prerequisites

- An application. To create one, refer to [Applications quickstart](/en/documentation/platform/applications/quickstart/).
- A hostname of a domain you own, and access to its DNS records at your DNS provider or in [Edge DNS](/en/documentation/platform/edge-dns/).
- To use the API, a personal token for the `Authorization` header, in the form `Token [TOKEN VALUE]`, and `curl`. To create a token, refer to [Personal tokens](/en/documentation/fundamentals/personal-tokens/).
- To use Azion Console, access to it. For more information, refer to [How to access Azion Console](/en/documentation/guides/platform/account-and-billing/how-to-access-azion-console/).

---

## Create the domain

**Console**

To create the domain in Azion Console:

1. **Open Domains**

   Access [Azion Console](https://console.azion.com/) > **Domains**.

2. **Start a domain**

   Select **+ Domain**, or select an existing domain to edit it.

3. **Name the domain**

   Enter a name. The name identifies the entry on the account and is not a hostname.

4. **Choose the environment**

   In **Environment Type**, select **Global Edge Network** for production or **Staging Network** for a test environment.

5. **Select the application and the firewall**

   In **Applications**, select your application. In **Firewall**, select your firewall.

6. **List the hostnames**

   In **CNAME**, list the hostnames you serve, one per line.

7. **Decide on the Azion address**

   Leave **CNAME access only** off to keep the `xxxxxxxxxx.map.azionedge.net` address reachable, or turn it on to answer only the hostnames you listed.

8. **Select the certificate**

   In **Digital Certificate**, select **Azion SAN** or a certificate of your own.

9. **Save the domain**

   Select **Save**.

**API v3**

To create the domain with API v3, send a `POST` to `/domains`. The request carries the header `Accept: application/json; version=3`, and `<application-id>` is the ID of the application the domain serves:

```bash
curl --request POST \
  --url https://api.azionapi.net/domains \
  --header 'Accept: application/json; version=3' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token [TOKEN VALUE]' \
  --data '{
  "name": "my-domain",
  "cnames": ["www.example.com"],
  "cname_access_only": false,
  "digital_certificate_id": null,
  "edge_application_id": <application-id>
}'
```

Replace `my-domain` with the name of the entry and `www.example.com` with a hostname you own. For what each key carries, refer to [Domain settings](/en/documentation/platform/domains/reference/#domain-fields).

The response returns the domain as Azion stored it, with its Azion address in `domain_name`:

```json
{
  "results": {
    "id": 1234567,
    "name": "my-domain",
    "cnames": ["www.example.com"],
    "cname_access_only": false,
    "digital_certificate_id": null,
    "edge_application_id": 1234567890,
    "is_active": true,
    "domain_name": "xxxxxxxxxx.map.azionedge.net"
  }
}
```

---

## Point your hostname at the domain

A listed hostname receives no traffic until DNS sends it there. Create a DNS record for the hostname that points at the address the domain answers on. For the record at each kind of DNS provider and how to check that it resolves, refer to [Point a domain to a workload](/en/documentation/guides/platform/migration/point-domain-to-azion/).

---

## Next steps

- [Point a domain to a workload](/en/documentation/guides/platform/migration/point-domain-to-azion.md): Create the DNS record that sends your hostname to your domain, and check that it resolves.
- [Bind a certificate to a domain](/en/documentation/guides/application-security/tls-and-certificates/digital-certificates.md#bind-the-certificate-to-a-v3-domain): Serve HTTPS on your hostname with a certificate you select on the domain.
- [Domain settings](/en/documentation/platform/domains/reference.md): Look up every field of a domain and its mTLS settings.
- [Limits](/en/documentation/platform/domains/limits.md): Check how many CNAMEs a domain takes.
