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

# ngrok Domains

> Learn how domains work with your ngrok endpoints, and how to use dev domains, wildcard domains, or a custom domain you already own.

## Domains

Domains enable you to create public endpoints with hostnames matching the domain.
For example, after you create the domain `your-name.ngrok.app`, you may create the Endpoint `https://your-name.ngrok.app`.

[Set up a custom domain on an ngrok account](https://www.youtube.com/embed/TliAZiDaevM)

Domain names may be a subdomain of an [ngrok-managed domain](#ngrok-managed-domains) like `foo.ngrok.app` or you can [bring your own domain](#branded-domains) like `example.your-domain.com` by creating a CNAME DNS record with your domain's DNS provider.

Domains also enable you to configure other domain-level behaviors including:

* [**Global Load Balancer configuration**](#global-load-balancer) - Choose which points of presence handle traffic to a Domain's matching endpoints.
* [**TLS Certificate management**](#tls-certificates) - Configure automatic certificate provisioning or select a certificate you uploaded yourself.
* [**Dedicated IP address configuration**](https://ngrok.com/docs/gateway/domains/dedicated-ips.md) - Attach static, dedicated IPs for a Domain's matching endpoints to receive traffic on.

You can manage Domains on your [ngrok dashboard](https://dashboard.ngrok.com/domains) or via the [ngrok API](#api).

## Public endpoints

A Domain's primary responsibility is to enable you to create [public endpoints](https://ngrok.com/docs/gateway/endpoints/public-endpoints.md) with a hostname matching the domain.
These are called "matching endpoints."
For example, after you create the Domain `app.example.com`, you can create the Endpoint `https://app.example.com`.

When you create a Domain, you may create matching public endpoints with the following constraints:

| Endpoint Protocol | Allowed Endpoints |
| - | - |
| `http` | Matching endpoints on port `80` of the Domain. |
| `https` | Matching endpoints on port `443` of the Domain. |
| `tls` | Matching endpoints on port `443` of the Domain. |
| `tcp` | Not allowed. Public TCP endpoints must match a [TCP Address](https://ngrok.com/docs/gateway/domains/tcp-addresses.md). |

If you configure your Domain to use [dedicated IPs](https://ngrok.com/docs/gateway/domains/dedicated-ips.md), these restrictions are removed and you may create matching endpoints on any ports.

### Dev domains

Every ngrok account, including free accounts, comes with a dev domain, such as `your-assigned-name.ngrok-free.dev`.
ngrok picks its name for you, and it's static: it doesn't change when you restart the agent, and you can't rename it.
You can use this domain for creating a public endpoint to host your app, API, or any other service you'd like to put online.
Dev domains aren't billed for endpoint hours and don't count toward the domain limits of paid plans.

When you start an endpoint without a URL, such as with `ngrok http 8080`, ngrok puts it on your dev domain automatically.
To use a different domain, pass it with `--url`:

* On the **Hobbyist** plan, you can reserve subdomains of ngrok-branded domains, such as `your-name.ngrok.app`.
* On the **Pay-as-you-go** plan, you can also [bring your own domain](https://ngrok.com/docs/gateway/domains/custom-domains.md), such as `app.example.com`.

On the **free plan**, you can only use your dev domain for public endpoints.

### Wildcard domains

You may create a Domain with a wildcard name, for example, `*.example.com`.
A wildcard domain enables you to:

* Create an endpoint which receives traffic for all of its subdomains, for example, `https://*.example.com`.
  Consult the documentation for [wildcard endpoints](https://ngrok.com/docs/gateway/endpoints/cloud-endpoints/http.md#wildcard-endpoints) to understand the rules for matching and precedence.

* Create an endpoint on any subdomain which matches the wildcard, for example, `https://foo.example.com` or `https://foo.bar.baz.example.com`.

You can only use the wildcard `*` character as the first part of a domain.
You can't create domains like `app.*.example.com` or `*-app.example.com`.

> [!NOTE]
>
> Wildcard endpoints are available on the Pay-as-you-go plan self service.
> For billing information on wildcard endpoints, including how endpoint hours and Traffic Policy are charged when using wildcard Cloud Endpoints that forward to internal endpoints, see the [wildcard endpoints pricing documentation](https://ngrok.com/docs/pricing-limits.md#wildcard-endpoints).

> [!NOTE]
>
> Reserving subdomains of a wildcard domain within the ngrok dashboard counts towards the number of reserved domains in your account.
> For example, if you reserve `foo.example.com` and `*.example.com`, you have reserved two domains.

### Auto-assigned domains

For some applications, you may not care much about the actual domain for the endpoint.
Rather than picking one yourself, you can use the value `https://` in the `url` field to have ngrok automatically assign your endpoint your account's [dev domain](#dev-domains):

```bash theme={"theme":{"light":"css-variables","dark":"css-variables"}}
ngrok http 80 --url 'https://'
```

The dev domain is a stable, auto-assigned hostname, so you get a usable public URL for your endpoint without reserving one yourself.

### Ownership

Your account exclusively owns its Domains and all of their [nested subdomains](https://ngrok.com/blog/public-suffix-list#down-the-ngrok-rabbit-hole) within ngrok.
That means:

* No account may create a Domain with a name that is a subdomain of your Domains.
* No other account may create endpoints with a hostname matching your Domain or any of its nested subdomains.

For example, if you create a Domain with the name `foo.ngrok.app`:

* No other account may create the Domains `foo.ngrok.app` or `bar.foo.ngrok.app`.
* No other account may create the endpoints `https://foo.ngrok.app` or `https://bar.foo.ngrok.app`.

## Bring your own domain

You can use any custom domain name that you already own with ngrok, for example, `app.your-domain.com`.
To do so, see [the docs on using custom domains](https://ngrok.com/docs/gateway/domains/custom-domains.md).

## Global Load Balancer

The [Global Load Balancer](https://ngrok.com/docs/gateway/domains/global-load-balancer.md) uses latency-aware DNS records to direct clients to the IPs of the nearest [points of presence](https://ngrok.com/docs/gateway/points-of-presence.md).

Domains allow you to configure which points of presence the Global Load Balancer may resolve clients to.
This allows you to select which points of presence receive traffic for the Domain's matching endpoints.
To disable the Global Load Balancer, you may configure a domain to only resolve a single point of presence.
See [region pinning](https://ngrok.com/docs/gateway/domains/region-pinning.md) to set this up.

## TLS certificates

Domains manage the [TLS Certificate](https://ngrok.com/docs/gateway/domains/tls-certificates.md) used to terminate TLS connections to the Domain's matching endpoints.
When you create a Domain, you may choose to allow ngrok to automatically provision TLS certificates for you or to upload your own TLS certificate.

Consult the documentation on [TLS Certificates](https://ngrok.com/docs/gateway/domains/tls-certificates.md) for additional details on certificate provisioning and management.

## Dedicated IPs

By default, a Domain's matching Endpoints receive traffic on a set of multi-tenant [IP addresses](https://ngrok.com/docs/gateway/domains/ip-addresses.md) that are shared among all ngrok accounts.
You may instead configure a Domain's matching endpoints to receive traffic on IP addresses that are dedicated to your account.

If your Domain uses dedicated IPs, you may create public endpoints on *any* port numbers, not just 80 and 443.

See the [Dedicated IPs](https://ngrok.com/docs/gateway/domains/dedicated-ips.md) documentation for detailed information on configuration, use cases, and pricing.

> [!NOTE]
>
> Dedicated, static IPs for your domains are in Early Access.
> [Request Early Access](https://dashboard.ngrok.com/early-access).

## ngrok managed domains

If you don't own a domain that you want to use with ngrok, you can create a Domain that is a subdomain of an ngrok-managed base domain.
The ngrok-managed base domains are:

| Domain | Availability | HSTS Global Preload |
| - | - | - |
| `ngrok.app` | Available to paying accounts | Yes |
| `ngrok.dev` | Available to paying accounts | Yes |
| `ngrok.pizza` | Available to paying accounts | No |
| `ngrok-free.app` | Used by free accounts | Yes |
| `ngrok-free.dev` | Used by free accounts | Yes |
| `ngrok-free.pizza` | Used by free accounts (coming soon) | No |
| `ngrok.io` | Available to paying accounts | No |

### Public Suffix List

The ngrok-managed base domains are on the [Public Suffix List](https://publicsuffix.org/), except `ngrok-free.pizza`, which is coming soon and isn't on the list yet.
Browsers use the Public Suffix List to prevent cookies from one subdomain from being accessed by other subdomains.
To learn more, read about [how browsers use the Public Suffix List](https://ngrok.com/blog/public-suffix-list).

### HSTS preload

Some of the ngrok-managed base domains are on the global [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) preload list.
If the domain of the URL is on the [global HSTS preload list](https://hstspreload.org/), modern browsers automatically convert requests with an `http` scheme to `https`.

If you need to create unencrypted `http` endpoints, create them with hostnames that aren't on the HSTS Global Preload like `ngrok.io` and `ngrok.pizza`.

ngrok doesn't prohibit you from creating `http` endpoints with hostnames whose base domain is on the global HSTS preload list because non-browser clients (like `curl`) can still make unencrypted HTTP requests to them.

## API

You can manage Domains programmatically via:

* [`/reserved_domains` API Resource](https://ngrok.com/docs/api-reference/reserveddomains/list)

## Domains pricing

Domains are available on all plans.
Some Domain features require upgrades.
See the [Pricing page](https://ngrok.com/pricing) for details.

| Feature | Plans |
| - | - |
| Domains | All plans. The Domain name is automatically assigned on Free; you may choose it on paid plans. |
| Bring-your-own domains | Pay-as-you-go |
| Wildcard endpoints | Pay-as-you-go |
| Auto-assigned domain (`https://`) | All plans. Assigns your account's dev domain to the endpoint. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.