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

# How to Set Up Your Custom Domain

> Learn how to configure a custom domain for your Shard Cloud application.

## Introduction

Configure your own custom domain on Shard Cloud to give your application a professional appearance. We recommend using **Cloudflare** as your DNS provider for the best compatibility.

## Registering a Domain

To use a custom domain, you must own a domain registered through a trusted registrar like:

* Cloudflare Registrar
* Namecheap
* GoDaddy
* Google Domains
* Any other accredited registrar

## Setting Up DNS with Cloudflare

We recommend using Cloudflare for DNS management due to its reliability and features.

<Steps>
  <Step title="Add Site to Cloudflare">
    Go to [Cloudflare](https://cloudflare.com/), navigate to **Sites**, and
    click **"Add a site"**.
  </Step>

  <Step title="Configure Nameservers">
    After adding your domain, Cloudflare will provide nameservers. Update your
    domain registrar's nameserver settings to use Cloudflare's nameservers.
  </Step>

  <Step title="Wait for Propagation">
    DNS changes can take up to 24-48 hours to propagate, though it's usually
    much faster.
  </Step>
</Steps>

## Configuring Your Domain on Shard Cloud

<Steps>
  <Step title="Access Application Settings">
    Go to [Shard Cloud Dashboard](https://shardcloud.app/dash/applications),
    select your application, and go to **Settings**.
  </Step>

  <Step title="Add Custom Domain">
    Find the custom domain section and enter your domain (e.g., `example.com` or
    `app.example.com`).
  </Step>

  <Step title="Save Configuration">
    Save your changes. Shard Cloud will provide you with DNS records to
    configure.
  </Step>
</Steps>

## Configuring DNS Records

In Cloudflare, add the following DNS records:

### CNAME Record

| Type  | Name           | Target               |
| ----- | -------------- | -------------------- |
| CNAME | @ or subdomain | `cname.shardweb.app` |

### TXT Record (Verification)

| Type | Name           | Value                     |
| ---- | -------------- | ------------------------- |
| TXT  | @ or subdomain | (provided by Shard Cloud) |

<Note>
  If using a subdomain like `app.example.com`, use `app` as the name instead of
  `@`.
</Note>

## Redirecting www to Your Domain

To redirect `www.example.com` to `example.com`:

<Steps>
  <Step title="Create A Record">
    Add an **A record** with: - Name: `www` - IP: `192.0.2.1` (Cloudflare's
    placeholder IP)
  </Step>

  <Step title="Create Page Rule">
    In Cloudflare, go to **Rules** → **Page Rules** and create: - URL:
    `www.example.com/*` - Setting: **Forwarding URL** (301 - Permanent Redirect)

    * Destination: `https://example.com/$1`
  </Step>
</Steps>

## SSL/HTTPS

Shard Cloud automatically provisions SSL certificates for your custom domain. HTTPS will be available shortly after DNS verification.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Site not found error">
    * Clear your browser cache - Wait 60 seconds and try again - Verify DNS
      records are correct in Cloudflare
  </Accordion>

  <Accordion title="Cloudflare 1015 error">
    Your domain is not configured correctly. Double-check that: - CNAME record
    points to `cname.shardweb.app` - TXT record for verification is added - DNS
    has propagated (use [dnschecker.org](https://dnschecker.org))
  </Accordion>

  <Accordion title="SSL certificate errors">
    Wait up to 24 hours for SSL certificate provisioning. If issues persist,
    contact support.
  </Accordion>
</AccordionGroup>

## Need Help?

If you continue having problems, [contact our support team](https://discord.gg/jjdYayFu5Q).
