Domains: custom hostnames
A domain block inside edge is a hostname the slice answers on, beyond its default <user>-<slice>.ondrift.eu. It is labelled with the hostname, and it sits with the rest of what reaches the slice.
edge {
domain "forms.gemeente.example" {}
domain "tenants.example.org" {
wildcard = true
}
}- Type
- label
- Default
- REQUIRED
- Meaning
- The hostname the slice should answer on. Compared in lower case.
- Type
- bool
- Default
false- Meaning
- Route every subdomain of the host to this slice too.
A domain is yours only once you have proved it. Declaring it attaches it to the slice; it does not route until a DNS TXT record proves you control the name. Point your DNS at the slice, publish the record, then run:
drift slice domain verify forms.gemeente.exampleverify re-checks the TXT record and, on success, issues the TLS certificate. Run it again if the record has not propagated yet. drift slice domain list shows each hostname and its status, and drift slice domain remove <host> takes one away, along with its certificate and routing.
The deploy adds what is missing: a host declared here and not yet on the slice is attached. A host live on the slice and absent here stays attached, and the apply names it in its closing report, so it is never removed behind your back. Two projects can share a slice, and a deploy cannot tell a host that is not yours from one you dropped. Take one away deliberately with drift slice domain remove <host>. drift plan lists each domain as domain forms.gemeente.example, with + when the apply would attach it. Domain reconcile is best-effort: a failure is reported but does not abort the rest of the deploy. A free slice grants no custom domains, so a file that declares one is priced, and drift plan says that the domain is what took it out of the free slice.
A verified domain can also be handed to another slice of yours: edge.hosts fronts a linked slice on a hostname this slice owns. Hostnames and domains covers the commands, verification and fronting end to end.
Two things wildcard does not mean.
alice.example.org from bob.example.org is your app's job. The apply attaches a new host with the wildcard its block declares. A host already on the slice keeps the setting it was attached with: the apply does not change it, so a host that should change is removed with drift slice domain remove <host> and attached again.