Skip to content
betterstack-alchemyUnofficial

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.

Better Stack Cloudteam
Blogwebsite · server ipv4
example.comzone at your DNS provider
blogA record
  • blogpoints at →Blog
The site runs on Better Stack Cloud; its A record lives in a zone at another DNS provider, written through that provider's DNS adapter.

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:

alchemy.run.ts
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.

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.