> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fleack.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure DNS to route your app's traffic through Fleack

> Add a CNAME record on your app's API hostname to activate Fleack, then verify the edge is receiving traffic before touching production.

Fleack's entire integration is one DNS record. You add a CNAME on a hostname you already control — the one your app calls today — and point it at the Fleack tenant hostname provisioned for you during onboarding. This page walks you through the setup, shows you how to confirm the edge is live, and explains three ways to test without touching production DNS.

## What you're configuring

You own your app's API hostname. Fleack provides a tenant hostname. You connect them with a CNAME:

| You control         | Fleack provides             |
| ------------------- | --------------------------- |
| `api.your-game.com` | `api-<tenant-id>.fleack.io` |

The `<tenant-id>` is shown on your Fleack dashboard as soon as your account is provisioned. You do not need to configure anything on the Fleack hostname itself — Fleack reads the `Host` header from each incoming request to route it to your tenant.

## Setting up DNS

<Steps>
  <Step title="Retrieve your tenant hostname">
    Sign in to the Fleack backoffice and open **Settings**. Copy the tenant hostname — it follows the format `api-<tenant-id>.fleack.io`.
  </Step>

  <Step title="Add the CNAME record">
    In your DNS provider, add a CNAME record on the hostname your app already calls:

    ```
    api.your-game.com  CNAME  api-<tenant-id>.fleack.io
    ```

    TTL can be left at your provider's default. A shorter TTL (60–300 s) makes it easier to roll back quickly if needed.
  </Step>

  <Step title="Wait for propagation">
    DNS changes typically propagate within a few minutes, though global propagation can take up to 48 hours depending on your provider and any upstream caches. In practice, most providers complete this in under five minutes.
  </Step>

  <Step title="Verify the edge is live">
    Run the three commands below to confirm everything is working:

    ```bash theme={null}
    # Should resolve to a Fleack address
    dig +short api.your-game.com

    # Should return your real backend's response, unchanged
    curl -sS https://api.your-game.com/api/health

    # Should show Fleack's edge headers
    curl -sIS https://api.your-game.com/api/health | grep -i x-fleack
    ```

    If the third command returns `x-fleack-tenant: <your-tenant-id>`, the Fleack edge is correctly receiving and forwarding your traffic.
  </Step>
</Steps>

<Note>
  Until you launch a test, every response through Fleack is byte-identical to what your backend sends directly. Fleack acts as a transparent proxy until you activate a variant.
</Note>

## Testing without changing production DNS

If you need to validate the integration before touching your production hostname, you have three options:

<Tabs>
  <Tab title="Staging hostname">
    Add a separate CNAME on a test hostname — for example `fleack-test.your-game.com` — pointing to the same Fleack tenant hostname:

    ```
    fleack-test.your-game.com  CNAME  api-<tenant-id>.fleack.io
    ```

    Configure your dev or staging app build to call `fleack-test.your-game.com` instead of `api.your-game.com`. You can run real tests against staging traffic for as long as you need before flipping the production record.

    This is the recommended approach for team-wide pre-production testing.
  </Tab>

  <Tab title="Host header override">
    For server-side or terminal-based tests, you can hit your Fleack tenant directly without any DNS change by overriding the `Host` header:

    ```bash theme={null}
    curl -H "Host: api.your-game.com" https://api-<tenant-id>.fleack.io/api/whatever
    ```

    Fleack routes purely on the `Host` header, so this request is treated exactly as if it came through the CNAME. Useful for quick one-off checks from your terminal.
  </Tab>

  <Tab title="Local /etc/hosts override">
    For testing on your local machine or a physical device on the same network, you can override DNS resolution by adding an entry to `/etc/hosts`:

    ```
    <resolved-ip>  api.your-game.com
    ```

    Replace `<resolved-ip>` with the IP address that `dig +short api-<tenant-id>.fleack.io` returns. Your local app build will then route through Fleack without any DNS change.

    <Warning>
      This override only applies to the machine where you edit `/etc/hosts`. It is suitable for individual verification, not team-wide testing.
    </Warning>
  </Tab>
</Tabs>

## Rolling back

Removing Fleack from the path is as simple as deleting or updating the CNAME. As soon as DNS propagates, your app calls your real backend directly again. No code changes, no app update, no downtime window required.
