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