# Domain settings

> 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.

A domain carries the settings below, in Azion Console and in API v3. This page lists each setting with its Console label, its API field, and what it does. For the number of CNAMEs a domain takes, refer to [Domains limits](/en/documentation/platform/domains/limits/).

---

## Domain fields

In API v3, you create a domain with a `POST` to `https://api.azionapi.net/domains` under the header `Accept: application/json; version=3`.

| Console label          | API field                        | Description                                                                                     |
| ---------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------- |
| Name                   | `name`                           | The name of the entry on the account. It is not a hostname                                      |
| Environment Type       |                                  | The environment of the domain: [Global Edge Network or Staging Network](#environment)           |
| Applications           | `edge_application_id`            | The ID of the application the domain serves                                                     |
| Firewall               |                                  | The firewall that inspects the requests of the domain                                           |
| CNAME                  | `cnames`                         | The hostnames the domain serves, one per line in Azion Console                                  |
| CNAME access only      | `cname_access_only`              | `false` keeps the Azion address reachable. `true` answers only the listed hostnames             |
| Digital Certificate    | `digital_certificate_id`         | The certificate of the domain. `null` selects the **Azion SAN** certificate                     |
| Mutual Authentication  | `is_mtls_enabled`                | `true` asks every client for a certificate. Refer to [mTLS](#mtls)                              |
| Mode                   | `mtls_verification`              | `enforce` or `permissive`                                                                       |
| Trusted CA Certificate | `mtls_trusted_ca_certificate_id` | The certificate of type `trusted_ca_certificate` that the client certificate is checked against |

The response returns the domain as Azion stored it. Besides the fields above, it carries these:

| API field     | Description                                                                   |
| ------------- | ----------------------------------------------------------------------------- |
| `id`          | The ID of the domain                                                          |
| `is_active`   | Whether the domain is active                                                  |
| `domain_name` | The Azion address of the domain, in the format `xxxxxxxxxx.map.azionedge.net` |

---

## 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 Edge Network**: production environment of the application. The Azion domain is in the format `xxxx.map.azionedge.net`.
- **Staging Network**: environment for testing the application. This configuration does not impact the production environment. The Azion domain is 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. For the limit and how to raise it, refer to [Domains limits](/en/documentation/platform/domains/limits/).

---

## Digital certificate

To use your domain in HTTPS, you 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 Azion manages automatically.

---

## 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`:

```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 a 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.

---

## Related resources

- [Domains](/en/documentation/platform/domains/)
- [Domains quickstart](/en/documentation/platform/domains/quickstart/)
- [Certificate Manager](/en/documentation/platform/certificate-manager/certificates/)
- [Add a custom domain to a workload](/en/documentation/guides/platform/migration/configure-a-domain/)
