Custom domains
Serve an app from your own domain.
A custom domain belongs to one app and one environment, usually production. Teral checks that the domain is yours, then issues and renews its certificate.
How many custom domains you can add depends on your plan. The dashboard tells you when you've reached the limit.
Add a domain
- Open the app's Settings and go to Advanced configurations → Custom Domains.
- Pick the environment and enter the domain, such as
api.example.com. - Add the DNS records the dashboard shows at your DNS provider.
DNS records
The dashboard lists two records. Create both, exactly as shown:
- A routing record that sends traffic to Teral. For a subdomain, like
api.example.com, it's aCNAMEpointing at the target the dashboard shows. Each domain gets its own target. An apex domain, likeexample.com, can't have aCNAME, so use your provider'sALIASorANAMErecord, or CNAME flattening, with the same target. - A
TXTrecord at_teral.<your domain>, which proves the domain is yours.
Sometimes Teral can tell from the routing record alone that the domain is yours. Often it can't, for example with flattened apex records, or when the domain is already verified in another workspace. With the TXT record in place it doesn't matter. If another workspace had the domain, it loses it once yours is verified.
If you use Cloudflare, set the routing record to DNS only, not proxied, so Teral can issue the certificate.
A domain can be added to only one environment per workspace.
Verification
Teral checks the records every minute for up to 24 hours, starting when you add the domain. Most providers are done in a few minutes. Once the records are right, the domain changes to Verified. Teral then requests a certificate from Let's Encrypt, and the domain starts serving your app a moment later.
If 24 hours pass without the right records, the domain is marked failed. Fix the records and select Retry verification.
To check what the internet sees:
dig CNAME api.example.com
dig TXT _teral.example.comRemove a domain
Select Delete domain in the domain's row. Traffic for the domain stops reaching your app right away. Remove the DNS records at your provider too.