Skip to content

tori domains

connect your own hostname to an app

npx tori.host domains list [app]

Your own hostname on an app. add prints the DNS record to create: a CNAME to the app's own name for a subdomain (www.example.com), or an A record to the zone's addresses for a zone apex (example.com, shop.co.uk), plus a TXT record that proves you own the name when an A record is used. The control plane checks the records on a schedule and, once it points here, the zone obtains a certificate. Nothing is issued before the record resolves. check re-runs the DNS check now, at most once per 30 s.

primary marks one active hostname as the one the app is canonically reached on, and redirect on makes every other hostname — the app's own tori.cloud name included — answer 301 to it with the path and query kept. Off by default. While the primary is not active (withdrawn after DNS drift, or its certificate expired unrenewed), every hostname serves again until it is back. Preview: primary and redirect are not yet generally available on api.tori.host; the static-deploy guide says when they are.

[app] is the app's slug. When it is left out, the app is read from ./tori.json. --json prints the API's answer instead of the lines.

  • --json — print the API's answer instead of the lines
  • --no-browser — do not open a browser; sign in only with a code typed on another device (chosen automatically over SSH or with no DISPLAY)
  • tori domains list [app] — list the app's custom domains and their state
  • tori domains add [app] <hostname> — connect a hostname; prints the DNS record to create
  • tori domains remove [app] <hostname|id> — withdraw a hostname
  • tori domains check [app] <hostname|id> — re-run the DNS check now
  • tori domains primary [app] <hostname|id> — choose the primary hostname
  • tori domains redirect [app] on|off — redirect the other hostnames to the primary
Terminal window
npx tori.host domains add my-app www.example.com

Serve everything on the apex, with www and the tori.cloud name redirecting to it

Section titled “Serve everything on the apex, with www and the tori.cloud name redirecting to it”
Terminal window
npx tori.host domains primary my-app example.com && npx tori.host domains redirect my-app on

Re-run the DNS check after fixing the record

Section titled “Re-run the DNS check after fixing the record”
Terminal window
npx tori.host domains check my-app www.example.com
Terminal window
npx tori.host domains list my-app --json

This reference matches tori.host@0.16.4.

Download this page as Markdown.