> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nadles.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom domain

You can attach a custom domain name to an API accessed via Nadles API Gateway, so that, instead of Nadles domain (`https://<subdomain>.p.nadles.com/`), users access your API by the domain name owned by you.

In order to successfully complete the setup, you must be able to edit DNS records of the domain name.

## Setting up a custom domain name

To start, navigate to **My APIs → choose API → Settings**.

Scroll the page down to the **Custom domain name** section.

<Frame>
  <img src="https://mintcdn.com/nadles/WGoKyNQHhztkDHRn/images/api-management/custom-domain.png?fit=max&auto=format&n=WGoKyNQHhztkDHRn&q=85&s=ac2b6b41e986e88028f58e8cf83819a3" alt="" width="1864" height="800" data-path="images/api-management/custom-domain.png" />
</Frame>

Here, enter the domain name you'd like to use for your API.

By clicking **Submit** you initiate a domain ownership verification process.

## Ownership verification

<Frame>
  <img src="https://mintcdn.com/nadles/WGoKyNQHhztkDHRn/images/api-management/domain-ownership-verification.png?fit=max&auto=format&n=WGoKyNQHhztkDHRn&q=85&s=152ee9a3a1f596c52190a10059523857" alt="" width="1858" height="1216" data-path="images/api-management/domain-ownership-verification.png" />
</Frame>

To verify ownership, you need to add two DNS records.

* TXT record for the base domain with a unique value generated by Nadles.

* CNAME record for the desired subdomain referencing the Nadles API Gateway's domain name, `p.nadles.com`.

In this example we're attaching `api.myfirstapi.com`, so the two records to add to `myfirstapi.com` are:

| Type  | Name | Value                                      |
| :---- | ---- | ------------------------------------------ |
| TXT   | @    | nadles\_verification\_8KcfbFwYGieHpqTY8... |
| CNAME | api  | p.nadles.com                               |

After you've added the records, click **Check DNS propagation status** and make sure that the records have propagated to the majority of the servers.

Then click **Verify DNS records** to make Nadles verify the ownership and issue a SSL certificate.

Once the SSL certificate is issued, the status is updated:

And your custom domain name is displayed everywhere instead of the standard access URL assigned by Nadles.

## Path prefix

If you plan to use the same domain name for several APIs, you need to specify the path prefix.

In case several APIs are configured to be served on the same domain name, Nadles API Gateway, just like many other API Gateways, will use the path prefix to distinguish between them.

<Info>
  **Example**

  Let's say, you plan to set up Weather and Currency APIs with Nadles on the same domain, e.g. `api.myapi.com`.

  You have to set different path prefixes for them in the "Custom domain name" section.

  **For Weather API:**

  * Custom domain name: `api.myapi.com`

  * Path prefix: `/weather/`

  When the user makes a request to `https://api.myapi.com/weather/*`, the request is forwarded to Weather API.

  **For currency API:**

  * Custom domain name: `api.myapi.com`

  * Path prefix: `/currency/`

  When the user makes a call to `https://api.myapi.com/currency/*`, the request is proxied to Currency API.
</Info>

The path prefix is stripped from the request URL before Nadles proxies the request to your API backend.

<Info>
  **Example**

  If Weather API from the previous example has a base URL

  `https://weather.execute-api.eu-central.amazonaws.com/`

  then the request

  `GET https://api.myapi.com/weather/current.json`

  is actually proxied to your API backend as

  `GET https://weather.execute-api.eu-central.amazonaws.com/current.json`

  Note that the `/weather` part was removed from the request URL.
</Info>

## SSL certificate

Once the domain ownership verification succeeds, Nadles automatically issues a SSL certificate for the domain name.

Nadles takes care of renewing the certificate when it approaches the expiration date.

When you connect your custom domain, it takes over as the primary URL for your API. This means your customers will see your own domain across all touchpoints, such as the checkout page and the self-service portal, replacing the standard Nadles URLs.
