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

# Custom Domain

> Connect your own domain to your Komerza store

To use a custom domain with your Komerza store, you must use **Cloudflare DNS**. Cloudflare provides the necessary proxy and DNS management features required for custom domains to work properly.

<Steps>
  <Step title="Sign Up for Cloudflare">
    If you don't already have a Cloudflare account, create one at [dash.cloudflare.com/sign-up](https://dash.cloudflare.com/sign-up).
  </Step>

  <Step title="Add Your Domain to Cloudflare">
    Once your account is created:

    1. Log in to your Cloudflare dashboard
    2. Click **Add a Site**
    3. Enter your domain name (e.g., `yourstore.com`)
    4. Select the **Free** plan (or any plan you prefer)
    5. Cloudflare will scan your existing DNS records
    6. Continue to the next step where Cloudflare will provide you with nameservers

    Cloudflare will assign you two nameservers. They typically look like this:

    ```
    aaron.ns.cloudflare.com
    bella.ns.cloudflare.com
    ```

    <Note>
      Your assigned nameservers will be different. Make sure to copy the exact nameservers shown in your Cloudflare dashboard.
    </Note>
  </Step>

  <Step title="Update Your Domain's Nameservers">
    You need to point your domain to Cloudflare's nameservers at your domain registrar.

    <Tabs>
      <Tab title="Namecheap">
        1. Log in to your [Namecheap account](https://www.namecheap.com/)
        2. Go to **Domain List** in the left sidebar
        3. Click **Manage** next to your domain
        4. Scroll down to the **Nameservers** section
        5. Click the dropdown and select **Custom DNS**
        6. Enter your Cloudflare nameservers:
           * **Nameserver 1**: Your first Cloudflare nameserver (e.g., `aaron.ns.cloudflare.com`)
           * **Nameserver 2**: Your second Cloudflare nameserver (e.g., `bella.ns.cloudflare.com`)
        7. Click the **green checkmark** button to save your changes
      </Tab>

      <Tab title="Other Registrars">
        The process is similar for most domain registrars:

        1. Log in to your domain registrar's control panel
        2. Navigate to your domain's settings or DNS management
        3. Look for **Nameservers** or **DNS Servers** settings
        4. Change from the default nameservers to **Custom Nameservers**
        5. Enter both Cloudflare nameservers provided to you
        6. Save your changes

        If you're unsure how to change nameservers with your specific registrar, search for "\[Your Registrar] change nameservers" or contact their support.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Configure DNS in Cloudflare">
    Once your nameservers have been updated and Cloudflare shows your domain as active:

    1. Go to your domain in the Cloudflare dashboard
    2. Click **DNS** in the left sidebar
    3. Click **Add Record**
    4. Configure the record:
       * **Type**: `CNAME`
       * **Name**: `@` (or enter a subdomain like `shop` if you want `shop.yourstore.com`)
       * **Target**: `fallback.mykomerza.com`
       * **Proxy status**: **Proxied** (orange cloud icon - this is required!)
    5. Click **Save**

    <Warning>
      **Important**: Make sure the proxy status shows the orange cloud icon (Proxied). If it shows a grey cloud (DNS only), click on it to enable proxying. The custom domain will not work without proxying enabled.
    </Warning>

    <Warning>
      **Existing DNS Records**: If you have existing DNS records (like A, CNAME, or NS records) for the same name, remove them to avoid conflicts before adding the new CNAME record.
    </Warning>
  </Step>

  <Step title="(Optional) Redirect www to Your Root Domain">
    If you want visitors to `www.yourstore.com` to be redirected to `yourstore.com`, follow these additional steps:

    ### Add a DNS Record for www

    1. In Cloudflare DNS settings, click **Add Record**
    2. Configure the record:
       * **Type**: `A`
       * **Name**: `www`
       * **IPv4 address**: `192.0.2.0` (this is a reserved placeholder IP)
       * **Proxy status**: **Proxied** (orange cloud)
    3. Click **Save**

    ### Create a Page Rule for the Redirect

    1. In Cloudflare, go to **Rules** > **Page Rules**
    2. Click **Create Page Rule**
    3. Enter the URL pattern: `www.yourstore.com/*`
    4. Click **Add a Setting** and choose:
       * **Setting**: Forwarding URL
       * **Status code**: 301 - Permanent Redirect
       * **Destination URL**: `https://yourstore.com/$1`
    5. Click **Save and Deploy Page Rule**
  </Step>

  <Step title="Wait for Propagation">
    DNS changes can take time to propagate across the internet.

    <Info>
      DNS propagation typically takes **24-48 hours** to complete worldwide, though it often happens much faster. During this time, some visitors may still see the old DNS settings while others see the new ones.
    </Info>

    You can check if your DNS has propagated using tools like [dnschecker.org](https://dnschecker.org/) or [whatsmydns.net](https://www.whatsmydns.net/).
  </Step>
</Steps>

## Troubleshooting

| Issue                             | Solution                                                             |
| --------------------------------- | -------------------------------------------------------------------- |
| Domain not working after 48 hours | Verify the CNAME record is correct and proxy is enabled              |
| SSL certificate errors            | Ensure Cloudflare's SSL/TLS mode is set to "Full" or "Full (Strict)" |
| www redirect not working          | Check that the Page Rule is active and the A record for www exists   |
| Cloudflare shows "Pending"        | Your nameservers haven't propagated yet - wait and check again       |
