S Technologies's Logo

Color

Green
Teal
Indigo
Blue
Purple
Red
Rose

Mode

Light

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.

CommandWhat it does
stechbd domain lsList hostnames, where each points, and whether it is serving
stechbd domain addAdd a hostname for production, or for a preview with --preview
stechbd domain targetPoint a hostname at production or at a preview
stechbd domain primaryMake a hostname the one generated links point at
stechbd domain rmStop serving a hostname
stechbd domain edgeWhether each hostname is cached at the managed edge, and the last purge
stechbd domain purgeEmpty 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.

bash
stechbd domain ls [--app <app>]
OptionDescription
--app <app>The application whose hostnames are listed. An id, or the slug in the linked project.
bash
stechbd domain ls

stechbd 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.

bash
stechbd domain add <hostname> [--preview <name>] [--primary] [--app <app>]
OptionDescription
<hostname>The hostname to add. Required
--preview <name>Serve the named preview instead of production
--primaryMake 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.
bash
# 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 review

stechbd 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.

bash
stechbd domain target <hostname> (--production | --preview <name>) [--yes] [--app <app>]
OptionDescription
<hostname>The hostname to move. Required
--productionServe production
--preview <name>Serve the named preview
--yesSkip the confirmation prompt when moving off production
--app <app>The application that owns the hostname. An id, or the slug in the linked project.
bash
# 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 --production

stechbd domain primary

Makes a hostname the one that generated links point at. Use it when the application’s main address changes.

bash
stechbd domain primary <hostname> [--app <app>]
OptionDescription
<hostname>The hostname to make primary. Required
--app <app>The application that owns the hostname. An id, or the slug in the linked project.
bash
stechbd domain primary www.example.com

stechbd 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.

bash
stechbd domain rm <hostname> [--yes] [--app <app>]
OptionDescription
<hostname>The hostname to stop serving. Required
--yesSkip the confirmation prompt
--app <app>The application that owns the hostname. An id, or the slug in the linked project.
bash
# Confirm, then remove
stechbd domain rm old.example.com

# In a script, with no prompt
stechbd domain rm old.example.com --yes

stechbd 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.

bash
stechbd domain edge [--app <app>]
OptionDescription
--app <app>The application whose hostnames are checked. An id, or the slug in the linked project.
bash
stechbd domain edge

stechbd 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.

bash
stechbd domain purge <hostname> [--app <app>]
OptionDescription
<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.
bash
stechbd domain purge www.example.com