Custom domains
Every app gets a getctrl.dev address. You can also serve it on your own domain, such as www.example.com. CTRL issues and renews the HTTPS certificate for you.
Adding a domain takes three steps: add it, prove you own it with a TXT record, then point it at CTRL with a CNAME.
1. Add the domain#
Open the app in the dashboard, find ctrl domains, enter the hostname and select + add domain. Through the API:
curl -X POST https://api.getctrl.dev/v1/apps/my-app/domains \
-H "Authorization: Bearer $CTRL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"hostname": "www.example.com"}'
The hostname must be a full domain name. CTRL refuses:
- wildcards such as
*.example.com; - bare top-level domains;
- IP addresses;
- anything under
getctrl.dev; - a domain another account has already verified.
An app can have up to 5 custom domains.
2. Prove you own it#
CTRL shows a TXT record for the domain. Add it at your DNS provider:
| Type | Name | Value |
|---|---|---|
TXT |
_ctrl-verify.www.example.com |
ctrl-verify=<token> |
The token is unique to this domain. Copy it from the dashboard, or from record in the API response.
Then select check now, or call:
curl -X POST https://api.getctrl.dev/v1/apps/my-app/domains/www.example.com/verify \
-H "Authorization: Bearer $CTRL_API_KEY"
If the record isn't visible yet, you get "verified": false with a message. DNS changes can take a few minutes to spread, so try again shortly. Each domain can be checked once every 10 seconds; checking sooner gets a 429.
3. Point it at CTRL#
Once the domain is verified, add a CNAME at your DNS provider:
| Type | Name | Value |
|---|---|---|
CNAME |
www.example.com |
customers.getctrl.dev |
CTRL then requests the certificate. Select check status to see how it's going. The domain moves through these statuses, shown in the dashboard and as status in the API:
| Status | Meaning |
|---|---|
unverified |
The TXT record hasn't been checked successfully yet. |
waiting_for_dns |
Verified; waiting to see the CNAME. |
issuing_certificate |
The CNAME is in place and the certificate is being issued. |
serving |
Your app answers on this domain over HTTPS. |
problem |
Something went wrong; problem says what. |
A serving domain is re-checked hourly, so a CNAME that moves away or a certificate that lapses shows up again as a status change.
Apex domains#
A domain without a subdomain, such as example.com, is an apex domain. Most DNS providers don't allow a plain CNAME there. Use your provider's CNAME flattening, ALIAS or ANAME record instead, with the same target, customers.getctrl.dev.
If your provider supports none of these, add www.example.com to CTRL and set up a redirect from example.com at your registrar.
www and apex together#
If you add both example.com and www.example.com to the same app, one serves the app and the other redirects to it. The domain you added first is the primary one. To switch, select make primary on the other, or:
curl -X PATCH https://api.getctrl.dev/v1/apps/my-app/domains/example.com \
-H "Authorization: Bearer $CTRL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"primary": true}'
List and remove domains#
# Every domain on the app, with its records and status
curl https://api.getctrl.dev/v1/apps/my-app/domains \
-H "Authorization: Bearer $CTRL_API_KEY"
# Remove one
curl -X DELETE https://api.getctrl.dev/v1/apps/my-app/domains/www.example.com \
-H "Authorization: Bearer $CTRL_API_KEY"
Select remove in the dashboard to do the same. Removing a domain stops CTRL serving it. You can then delete the TXT and CNAME records at your DNS provider.