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.
- You can also create a Domain via the ngrok API.
- When you create a Domain in the dashboard, you'll be given a
CNAME
value such asexampledata.otherdata.ngrok-cname.com
. Copy it.- This value will be in the
"cname_target"
field of the response object if you create a Domain via the API.
- This value will be in the
- In a new browser 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.
ngrok is not a domain registrar; you must already own a domain name to use it with ngrok.
Wildcard domains
If you bring your own wildcard domain, e.g. *.example.com
, you will need to create a second CNAME
record with your domain host for wildcard TLS Certificate provisioning.
Apex domains
Because it's not possible to create CNAME
records for apex domains, if you want to use an apex domain, e.g. example.com
, you must use a DNS provider that supports an ALIAS
record or CNAME
flattening.
Because of how ALIAS
/CNAME
flattening is implemented, apex domains will not take advantage of the Global Load Balancer. If you're trying to create your apex domain because you need to create endpoints for multiple subdomains, use a wildcard domain instead.