Domain
Add, move and remove the hostnames an application serves, and manage its edge cache.
stechbd domain manages the hostnames in front of an application: which deployment each one serves, which one generated links point at, and whether the edge cache is emptied for it. Use it after a deploy changes what a hostname should serve, or when a page is stale. Every command accepts --app <app> and --json.
| Command | What it does |
|---|---|
stechbd domain ls | List hostnames, where each points, and whether it is serving |
stechbd domain add | Add a hostname for production, or for a preview with --preview |
stechbd domain target | Point a hostname at production or at a preview |
stechbd domain primary | Make a hostname the one generated links point at |
stechbd domain rm | Stop serving a hostname |
stechbd domain edge | Whether each hostname is cached at the managed edge, and the last purge |
stechbd domain purge | Empty the edge cache for one hostname, without deploying |
stechbd domain ls
Lists the hostnames on the application, where each one points, and whether it is serving. Use it to check a hostname before changing it, or to see which preview a hostname is on.
stechbd domain ls [--app <app>]| Option | Description |
|---|---|
--app <app> | The application whose hostnames are listed. An id, or the slug in the linked project. |
stechbd domain lsstechbd domain add
Adds a hostname to the application. It serves production unless --preview names a preview, and the target is set in the same request, so the hostname never points somewhere else first. --primary makes it the hostname that generated links point at. It is only allowed for a hostname that serves production.
stechbd domain add <hostname> [--preview <name>] [--primary] [--app <app>]| Option | Description |
|---|---|
<hostname> | The hostname to add. Required |
--preview <name> | Serve the named preview instead of production |
--primary | Make this hostname the one generated links point at. Not allowed with --preview |
--app <app> | The application to add the hostname to. An id, or the slug in the linked project. |
# Serve production on a hostname of your own
stechbd domain add www.example.com
# Serve a preview on a hostname, as one request
stechbd domain add review.example.com --preview reviewstechbd domain target
Points an existing hostname at production or at a preview. This is the deliberate way to move a hostname, and it is the reason deploy:preview --domain refuses to move one. Moving a hostname off production asks first. Moving it onto production does not, because that is what promoting a hostname means.
stechbd domain target <hostname> (--production | --preview <name>) [--yes] [--app <app>]| Option | Description |
|---|---|
<hostname> | The hostname to move. Required |
--production | Serve production |
--preview <name> | Serve the named preview |
--yes | Skip the confirmation prompt when moving off production |
--app <app> | The application that owns the hostname. An id, or the slug in the linked project. |
# Send a hostname to a preview for review
stechbd domain target www.example.com --preview review
# Bring it back to production
stechbd domain target www.example.com --productionstechbd domain primary
Makes a hostname the one that generated links point at. Use it when the application’s main address changes.
stechbd domain primary <hostname> [--app <app>]| Option | Description |
|---|---|
<hostname> | The hostname to make primary. Required |
--app <app> | The application that owns the hostname. An id, or the slug in the linked project. |
stechbd domain primary www.example.comstechbd domain rm
Stops the application serving a hostname. Whatever it served stops answering there. The hostname is removed from the application, so adding it again is a new domain add. Use it when a hostname should no longer point at this application.
stechbd domain rm <hostname> [--yes] [--app <app>]| Option | Description |
|---|---|
<hostname> | The hostname to stop serving. Required |
--yes | Skip the confirmation prompt |
--app <app> | The application that owns the hostname. An id, or the slug in the linked project. |
# Confirm, then remove
stechbd domain rm old.example.com
# In a script, with no prompt
stechbd domain rm old.example.com --yesstechbd domain edge
Shows whether each hostname is cached at the managed edge, and when the cache was last purged. Use it to check whether a stale page is still being served from the cache.
stechbd domain edge [--app <app>]| Option | Description |
|---|---|
--app <app> | The application whose hostnames are checked. An id, or the slug in the linked project. |
stechbd domain edgestechbd domain purge
Empties the managed edge cache for one hostname, without deploying. Every deploy already purges, so use this only for a page that went stale some other way. The command is refused before anything is sent when the hostname is not behind the managed edge, and the refusal gives the reason. It needs the same permission as a deploy.
stechbd domain purge <hostname> [--app <app>]| Option | Description |
|---|---|
<hostname> | The hostname whose cache is emptied. Required |
--app <app> | The application that owns the hostname. An id, or the slug in the linked project. |
stechbd domain purge www.example.com