diff --git a/.optimize-cache.json b/.optimize-cache.json index 0a88231814..96366607fc 100644 --- a/.optimize-cache.json +++ b/.optimize-cache.json @@ -346,6 +346,7 @@ "images/blog/client-vs-server-components-react/cover.png": "b7ae8b7614902c8b4dd7826d59cfdb36db9abbe27bde99b3deb69c4bf178f425", "images/blog/cloud-beta.png": "7e44c7c7108d43bfcc77ba0c9910bfb14ba208bf559863d91610b29fc07da87c", "images/blog/cloud-pricing.png": "2018d3cd01b12c289c3f66b780ff8518a13fc44da58efb19420fc67e367dc8cf", + "images/blog/cname-flattening-for-appwrite-sites/cover.png": "612a77f799df64b9407ba37f64ca4acf2f4772b5e883de00102b0b606b60e674", "images/blog/common-appwrite-mistakes-and-how-to-avoid-them/cover.png": "c1d0620fa048cfeacdf4b55ebdc176acf3587e9effe7bc5be88599624c343f45", "images/blog/community-pr.png": "112e1637eb62a95da227bb45bfe18a474cdd86b078877e21ae5ee57bfc959e29", "images/blog/community-pr1.png": "22362832160073257e59cec48d4bea2bdd92139a6d1ee409c66a51cb1e2ccc47", diff --git a/src/routes/blog/post/cname-flattening-for-appwrite-sites/+page.markdoc b/src/routes/blog/post/cname-flattening-for-appwrite-sites/+page.markdoc new file mode 100644 index 0000000000..12e4ec3657 --- /dev/null +++ b/src/routes/blog/post/cname-flattening-for-appwrite-sites/+page.markdoc @@ -0,0 +1,99 @@ +--- +layout: post +title: CNAME flattening for Appwrite sites +description: Appwrite Sites now supports CNAME flattening, making it easier to connect custom domains without transferring DNS control or changing nameservers. +date: 2026-03-16 +cover: /images/blog/cname-flattening-for-appwrite-sites/cover.png +timeToRead: 5 +author: aishwari +category: tutorial +featured: false +unlisted: true +--- + +For most developers, the last step of deploying a site is connecting a custom domain. It should be the easiest part, but DNS often makes it the hardest. Previously, when using Appwrite Sites, pointing an apex domain to your site required changing your nameservers to Appwrite. While this approach worked, migrating nameservers comes with several inconveniences: + +- **Downtime during migration:** Your site may remain unavailable until DNS propagation fully completes, which can cause brief but noticeable periods of downtime. +- **Misconfigured DNS records:** Manually recreating all existing DNS records under a new nameserver is error-prone, and a single mistake can break services tied to your domain. +- **Proxied DNS conflicts:** If you rely on a provider like Cloudflare for proxied DNS (DDoS protection, caching, etc.), switching nameservers away means losing those features. +- **Mail forwarding disruption:** Providers like Cloudflare offer built-in email routing and forwarding. Migrating nameservers can silently break these configurations, causing missed emails. + +Appwrite Sites now supports CNAME flattening, which means `yourdomain.com` can point directly to your Appwrite project. No subdomain. No redirect. No compromise. + +[Read the official announcement.](https://appwrite.io/blog/post/announcing-cname-flattening) + +# The DNS rule that's been slowing you down + +DNS has a hard rule: **You cannot place a CNAME record at the root of your domain.** + +A CNAME record says "this name is an alias for another name, go look that up instead." That works perfectly on subdomains: + +`yourproject.yourdomain.com` → CNAME → `yourproject.appwrite.io` + +But at the root, your domain needs other critical records to exist alongside it: your MX records (email delivery), SPF and DKIM (email authentication), TXT records for domain verification. + +A CNAME at the root conflicts with all of them. Put one there and you risk silently breaking your email setup, landing in spam folders, or failing domain verification entirely. + +# What CNAME flattening actually does + +CNAME flattening solves the apex domain problem without requiring you to change nameservers. + +Instead of storing a CNAME record at the root, your DNS resolver **follows the CNAME chain at query time** and returns only the final A or AAAA IP address, as if you'd hardcoded the IP directly. + +From the outside, it looks like a normal A/AAAA record. Under the hood, your DNS provider is dynamically resolving the alias and returning the final IP address every time. + +That means if Appwrite's IPs ever change, your domain stays correct automatically. No manual updates. No downtime. + +Cloudflare calls this **CNAME Flattening**. AWS Route 53 calls it **ALIAS records**. DNSimple and NS1 call it **ANAME**. + +Different names, same idea. And now it's supported by Appwrite. + +# What this unlocks for your projects + +With CNAME flattening support in Appwrite, you get: + +- **A clean root domain:** `yourdomain.com` loads your app exactly as intended +- **Zero redirect overhead:** no bouncing through `www` before landing on your content +- **Intact DNS records:** MX, SPF, DKIM, TXT records all coexist at the apex without conflict +- **Automatic IP resolution:** if Appwrite infrastructure changes, your domain follows automatically + +# Which DNS providers support this? + +Most modern DNS providers support CNAME flattening or an equivalent feature: + +- **Cloudflare:** CNAME Flattening (enabled by default on proxied records) +- **AWS Route 53:** ALIAS records at the zone apex +- **DNSimple:** ALIAS records +- **NS1:** ANAME records +- **Google Cloud DNS:** supported via forwarding zones + +If your DNS provider doesn't support flattening, you can also manage your domain through Appwrite by pointing your nameservers to Appwrite. + +# Setting it up + +There's no special toggle. No extra configuration. + +Just add your root domain the same way you'd add any custom domain in Appwrite: + +1. Open your **Appwrite Console** and select your project +2. Go to **Settings → Domains** +3. Click **Add Domain** and enter your root domain: `yourdomain.com` +4. Add the DNS records Appwrite provides to your DNS provider +5. Wait for propagation (typically a few minutes to a few hours) + +That's it. Appwrite handles CNAME flattening on its end once your domain is verified. + +Full setup details are available in the [Appwrite custom domains documentation.](https://appwrite.io/docs/advanced/platform/custom-domains) + +# One less thing to work around + +The best developer tools are the ones that make you forget the problem ever existed. + +CNAME flattening is one of those things. Small on the surface, meaningful in practice. + +Your root domain now works the way you always expected it to. Ship with confidence. + +# Resources + +- [Appwrite Sites docs](https://appwrite.io/docs/products/sites) +- [Appwrite Discord](https://appwrite.io/discord) diff --git a/static/images/blog/cname-flattening-for-appwrite-sites/cover.png b/static/images/blog/cname-flattening-for-appwrite-sites/cover.png new file mode 100644 index 0000000000..d85cc15025 Binary files /dev/null and b/static/images/blog/cname-flattening-for-appwrite-sites/cover.png differ