Staticbot logoStaticbot.dev

    Custom Domain Setup

    Connecting a custom domain makes your project look professional. Staticbot makes this easy, but the method you use depends on whether you're setting up a subdomain (like `www.example.com`) or a root domain (also called an apex domain, like `example.com`).

    CNAME vs. ANAME/ALIAS Records

    Your choice between a CNAME and an ANAME/ALIAS record depends on your specific needs.

    CNAME Record

    Use for: Subdomains (e.g., `www.`, `blog.`, `app.`)

    A CNAME (Canonical Name) record points a subdomain to another domain name. It's the standard and most common way to handle subdomains. However, due to DNS specifications, you cannot use a CNAME record for a root domain.

    How to add a CNAME Record

    ANAME / ALIAS Record

    Use for: Root/Apex Domains (e.g., `example.com`)

    An ANAME or ALIAS record behaves like a CNAME but can be used on the root domain. It works by resolving the target domain's IP address on the server side and returning it as an A record. This is the recommended method for pointing your root domain to Staticbot if your DNS provider supports it.

    How to add an ANAME/ALIAS Record

    Summary: Which one to use?

    • To point `www.yourdomain.com` to your Staticbot site, use a CNAME record.
    • To point `yourdomain.com` (the root) to your Staticbot site, use an ANAME or ALIAS record.
    • If your DNS provider doesn't support ANAME/ALIAS records for the root domain, you'll need to use an A record with a static IP (not recommended for dynamic services) or use a provider like Cloudflare that offers "CNAME flattening".
    • If your site is served on `www` (some platforms issue the certificate for the www hostname), point the root domain at it with a 301 URL redirect from the apex to www.

    Getting the bare example.com working over HTTPS

    A root/apex domain can't be a plain CNAME, so serving example.com itself (not just www.) over HTTPS for an app hosted on Staticbot needs one of two setups. Pick based on where your DNS lives today.

    Option A — Your domain already runs on Cloudflare

    If your domain's nameservers already point at your own Cloudflare zone, you don't need to move anything. Connect your Cloudflare account to Staticbot (Integrations → Cloudflare, using a scoped API token) and link it to the domain. Staticbot writes the certificate-validation and website records straight into your existing zone, and Cloudflare's CNAME flattening makes the bare apex resolve over HTTPS. No nameserver change — you keep full control of your zone and all your existing records.

    Option B — Delegate your nameservers to Staticbot

    For any other setup (registrar DNS, a provider without apex/flattening support, or you'd simply rather Staticbot ran it), point your domain's nameservers at Staticbot's managed Cloudflare zone. Instead of editing individual records, you hand DNS for the whole domain to Staticbot: it serves the apex with a valid certificate, sets up the apex → www redirect automatically, and imports your existing records (email/MX included) first.

    How to change your nameservers