DNS
Better Stack has no DNS product: it hosts no zones and no records. Where
Hetzner’s provider has Zone and RecordSet resources, this one has
none. The records for your domains live with whichever DNS provider holds
the zone, and Alchemy reaches that provider through its
DNS adapters.
- blogpoints at →Blog
A website’s domain
Section titled “A website’s domain”Every Cloud.Website.* composite takes a domain
with a DNS adapter of another provider. Deploying it publishes an A
record at the server’s public IPv4:
const site = yield* BetterStack.Cloud.Website.StaticSite("Blog", { command: "hugo --minify", outdir: "public", domain: { name: "blog.example.com", dns: Cloudflare.DNS.Adapter() },});Add that provider’s package and providers() to the stack, here
@alchemy.run/cloudflare and Cloudflare.providers(). The site’s url
becomes http://blog.example.com:3000. The record is IPv4 only, because
the site listens on 0.0.0.0.
A plain string, domain: "blog.example.com", is accepted for source
compatibility with Hetzner.Website.* and fails with WebsiteDomainError
before anything is deployed: there is no zone to create the record in. A
dns naming an adapter whose provider isn’t in the stack fails with
Alchemy’s DnsAdapterNotRegistered.
The site speaks plain HTTP on port 3000. For HTTPS on 443, put a load balancer in front with a managed certificate, and point the domain’s record at the load balancer at your DNS provider. Let’s Encrypt validates the domain through that record, so the certificate is issued once it resolves.
Servers, Services and load balancers
Section titled “Servers, Services and load balancers”Only the website composites take a domain. For a server, a Service or a
load balancer, create the record with your DNS provider, pointing at the
server’s ipv4 or a reserved IP when the
address must survive the server being replaced.
Where next
Section titled “Where next”- Websites: the composites that take a
domain. - Networks, firewalls & load balancers.
- DNS adapters in Alchemy’s docs.