# Domains

> **Important**
>
> We're releasing a significant update to our platform. To learn more about the changes and required migration steps, see the [API v4 rollout page](/en/documentation/fundamentals/api-v4-migration/).

> **important**
>
> The Domains feature has been replaced by **Workloads.**
> For more information about the new product, visit the [Workloads Reference](/en/documentation/platform/workloads/).

**Domains** is an [Azion Console](https://console.azion.com) tool that provides a domain generation and management service.

When you [build an application](/en/documentation/platform/applications/quickstart/), your application is given an automatically generated **Azion domain**, in the format `xxxx.map.azionedge.net`. You can create multiple domains for your applications.

If you already own a domain, you can [redirect your traffic to Azion](/en/documentation/guides/platform/migration/point-domain-to-azion/) by configuring the records in your DNS provider and listing your **custom domains**.

You may also bind a **Digital Certificate** to domains that use the HTTPS protocol.

## Implementation

| Scope                     | Resource                                                                                      |
| ------------------------- | --------------------------------------------------------------------------------------------- |
| Adding a custom domain    | [Getting started](/en/documentation/guides/platform/migration/configure-a-domain/)            |
| About Certificate Manager | [Certificate Manager](/en/documentation/platform/workloads/certificate-manager/certificates/) |
| About mTLS                | [mTLS](/en/documentation/platform/workloads/mtls/)                                            |

---

## Environment

Before going operational, you can activate a testing configuration to preview setups. When creating a new Domain, you can choose the environment type:

- \**Global Infrastructure*: production environment of the application. The Azion domain will be in the format `xxxx.map.azionedge.net`.
- **Staging Network**: environment for testing the application. This configuration won't impact the **Production** environment. The Azion domain will be in the format `xxxx.preview.azionedge.net`.

To enable environment selection, contact the [Sales Team](https://www.azion.com/en/contact/).

---

## CNAME

CNAME is the standard service responsible for creating CNAME settings, enabling you to customize the application's domain.

You may restrict access to your application from the Azion domain by enabling the **CNAME Access Only** switch.

The **default limit** is *50* CNAMEs per domain. However, you can increase the limits based on your plan, contacting the [technical support team](/en/documentation/support/). To know more about Domains limits, check the [section](#limits) below.

---

## Digital Certificate

To use your domain in HTTPS, you'll need a TLS certificate (X.509). Without additional costs, you may include your TLS certificates in [Azion Console](https://console.azion.com) or generate a *Let's Encrypt*™ certificate, which will be automatically managed by Azion.

---

## Support for Mutual Transport Layer Security (mTLS)

A domain can ask every client for a certificate during the TLS handshake and validate it against a Trusted CA certificate. Azion activates mTLS per account, so to use it, contact the [Sales team](https://www.azion.com/en/contact/). The Open Banking model requires mTLS, so domains that serve financial services and payments often need it. For what the check does and what each verification mode decides, refer to [mTLS](/en/documentation/platform/workloads/mtls/).

A domain carries three mTLS fields:

| Field                            | Type    | Description                                                                                     |
| -------------------------------- | ------- | ----------------------------------------------------------------------------------------------- |
| `is_mtls_enabled`                | boolean | `true` asks every client for a certificate                                                      |
| `mtls_verification`              | string  | `enforce` or `permissive`                                                                       |
| `mtls_trusted_ca_certificate_id` | integer | The certificate of type `trusted_ca_certificate` that the client certificate is checked against |

In Azion Console, the domain form carries them in its **Mutual Authentication Settings** section: the **Mutual Authentication** switch, **Mode** with the cards **Enforce** and **Permissive**, and **Trusted CA Certificate**, which is required and closes with **Create Digital Trusted CA certificate**. The form has no field for a certificate revocation list: a CRL is attached to a workload, in `mtls.config.crl`.

In API v3, the three fields travel with the rest of the domain, on a `POST` to `https://api.azionapi.net/domains` under the header `Accept: application/json; version=3`:

```json
{
  "name": "mydomain.com",
  "cnames": ["mydomain.com"],
  "digital_certificate_id": null,
  "edge_application_id": <application-id>,
  "is_mtls_enabled": true,
  "mtls_verification": "enforce",
  "mtls_trusted_ca_certificate_id": <trusted-ca-id>
}
```

The Trusted CA certificate itself is uploaded with `certificate_type` set to `trusted_ca_certificate`, on a `POST` to `https://api.azionapi.net/digital_certificates`. An account on API v4 sets mTLS on the workload instead, and [Configure mTLS on a workload](/en/documentation/guides/application-security/tls-and-certificates/associate-an-mtls-certificate/) has those steps.

---

## Local staging of custom domain

The local `etc/hosts` file maps IP addresses to domains. When you [map your domain to the IP addresses of your workload](/en/documentation/guides/application-development/getting-started/stage-applications-through-hosts-file/) in your `hosts` file, you force your computer's DNS resolution to access this domain through Azion and not through public DNS servers. This way, you can test your application locally as if it were already deployed on your custom domain before you [point your domain](/en/documentation/guides/platform/migration/point-domain-to-azion/) to Azion.

---

## Limits

> **Tip**
>
> **Increase limits** \
> You can request to increase the limits based on your plan. Contact the [technical support team](/en/documentation/support/) to request it.

These are the **default limits**:

| Scope             | Limit |
| ----------------- | ----- |
| CNAMEs per domain | 50    |

These are the **default limits** for each Support service:

| Scope               | Developer | Business | Enterprise | Mission-Critical |
| ------------------- | --------- | -------- | ---------- | ---------------- |
| Domains per account | 100       | 100      | 100        | 1,000            |

> **Tip**
>
> **Increase limits** \
> You can request to increase the limits based on your plan. Contact the [technical support team](/en/documentation/support/) to request it.
