How do I Use My Own Domain?
You can use any domain name that you already own with ngrok, e.g.
app.your-domain.com
. To do so:
- Create a Domain in the ngrok dashboard. You can do so by going here.
- When you create a Domain, you'll be given a
CNAME
value such asexampledata.otherdata.ngrok-cname.com
. Copy it. - In a new tab, navigate to your domain hosting provider's dashboard and create a CNAME record. Check your hosting provider's support content or documentation to learn how.
- Typically, this process includes creating a DNS record.
- When configuring the record, use the following values:
- Its type should be
CNAME
- Its name should be
@
- Its value should be the
CNAME
value you copied from the ngrok dashboard.
- Its type should be
- Add the
CNAME
value you copied from to point traffic from the domain to ngrok's cloud service. When you create a Domain, you will be presented with a target value for the CNAME record you need to create. If you create the Domain via API, this value is thecname_target
field.
If you bring your own wildcard domain, you will need to create a second DNS CNAME record for wildcard TLS Certificate provisioning.
ngrok is not a domain registrar; you must already own a domain name to use it with ngrok.
Apex domains
If you want to use an apex domain (e.g. example.com
) with ngrok, you must use
a DNS provider that supports an ALIAS record or CNAME flattening because the
DNS RFC does not permit CNAME records for apex domains. Because of how
ALIAS/CNAME flattening is implemented, apex domains will not take advantage of
the Global Load Balancer. If you are trying to create
your apex domain because you need to create endpoints for multiple subdomains,
use a wildcard domain instead.