Domains
Domains enable you to create public endpoints with hostnames matching the domain. For example, after you create the domainyour-name.ngrok.app, you may create the Endpoint https://your-name.ngrok.app.
Domain names may be a subdomain of an ngrok-managed domain like foo.ngrok.app or you can bring your own domain 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 - Choose which points of presence handle traffic to a Domain’s matching endpoints.
- TLS Certificate management - Configure automatic certificate provisioning or select a certificate you uploaded yourself.
- Dedicated IP address configuration - Attach static, dedicated IPs for a Domain’s matching endpoints to receive traffic on.
Public endpoints
A Domain’s primary responsibility is to enable you to create public endpoints with a hostname matching the domain. These are called “matching endpoints.” For example, after you create the Domainapp.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:
If you configure your Domain to use dedicated IPs, 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 asyour-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, such as
app.example.com.
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 to understand the rules for matching and precedence. -
Create an endpoint on any subdomain which matches the wildcard, for example,
https://foo.example.comorhttps://foo.bar.baz.example.com.
* character as the first part of a domain.
You can’t create domains like app.*.example.com or *-app.example.com.
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.
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 valuehttps:// in the url field to have ngrok automatically assign your endpoint your account’s dev domain:
Ownership
Your account exclusively owns its Domains and all of their nested subdomains 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.
foo.ngrok.app:
- No other account may create the Domains
foo.ngrok.apporbar.foo.ngrok.app. - No other account may create the endpoints
https://foo.ngrok.apporhttps://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.
Global Load Balancer
The Global Load Balancer uses latency-aware DNS records to direct clients to the IPs of the nearest points of presence. 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.Per-region global load balancer configuration is coming soon.
Request Early Access.
TLS certificates
Domains manage the TLS Certificate 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 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 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 documentation for detailed information on configuration, use cases, and pricing.Dedicated, static IPs for your domains are in Early Access.
Request 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:Public Suffix List
The ngrok-managed base domains are on the Public Suffix List, exceptngrok-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.
HSTS preload
Some of the ngrok-managed base domains are on the global HSTS preload list. If the domain of the URL is on the global HSTS preload list, modern browsers automatically convert requests with anhttp 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.