---
title: "Connecting Your Branded Custom Domain"
description: "Attach a custom branded domain to your Shaf workspace with automatic TLS certificate issuance and fallback routing in 4 minutes."
---

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

# Connecting Your Branded Custom Domain

# Connecting Your Branded Custom Domain

Connect a custom branded domain to your Shaf workspace with automatic TLS certificate issuance and fallback routing in 4 minutes.

---

## Prerequisites

- Administrative access to your DNS registrar or DNS management zone (Cloudflare, AWS Route 53, Namecheap, GoDaddy).
- A Shaf workspace with `Owner` or `Admin` privileges.
- A chosen custom subdomain (for example, `link.yourbrand.com`).

---

## Step-by-Step Instructions

1. **Register Custom Domain in Shaf Dashboard**

   Navigate to [dash.shaf.app/dashboard/settings/domains](https://dash.shaf.app/dashboard/settings/domains) and click **Add Domain**.

   Enter your target hostname:

   ```text
   link.yourbrand.com
   ```

   Click **Add Domain**. Shaf registers the custom hostname with Cloudflare for SaaS and exposes the required CNAME routing target.

   **Expected output:**
   The domain list displays your entry with `Pending DNS Verification` status:

   ```text
   Hostname:       link.yourbrand.com
   Status:         Pending DNS Verification
   Target CNAME:   cname.shaf.app
   SSL / TLS:      Pending Validation
   ```
2. **Configure DNS CNAME Record**

   Log into your DNS provider's management console and add a CNAME record mapping your subdomain to `cname.shaf.app`.

   ### Cloudflare DNS

   1. Open the Cloudflare Dashboard and select your zone.
   2. Go to **DNS** → **Records** → Click **Add record**.
   3. Set **Type** to `CNAME`, **Name** to `link`, and **Target** to `cname.shaf.app`.
   4. Toggle **Proxy status** to **DNS only** (Grey Cloud).
   5. Click **Save**.

   > **Cloudflare Users Must Use DNS Only**
   >
   > Setting Proxy status to Proxied (Orange Cloud) triggers HTTP `1000: DNS points to prohibited IP`. Ensure the proxy toggle is set to **DNS only**.

   ### AWS Route 53

   1. Open the AWS Route 53 console and select your hosted zone.
   2. Click **Create record**.
   3. Enter **Record name**: `link`.
   4. Select **Record type**: `CNAME`.
   5. Enter **Value**: `cname.shaf.app`.
   6. Set **TTL**: `300` seconds. Click **Create records**.

   ### Namecheap

   1. Go to your Namecheap Domain List and click **Manage**.
   2. Open the **Advanced DNS** tab and click **Add New Record**.
   3. Select **CNAME Record**, set **Host** to `link`, and **Target** to `cname.shaf.app`.
   4. Set **TTL** to `Automatic` and click the checkmark to save.

   ### Generic DNS Provider

   Add the canonical alias record to your DNS table:

   | Type | Name / Host | Target Value | TTL |
   | :- | :- | :- | :- |
   | `CNAME` | `link` | `cname.shaf.app` | 300s / Auto |

   Verify DNS propagation from your terminal:

   ```bash
   dig +short link.yourbrand.com CNAME
   ```

   **Expected output:**

   ```text
   cname.shaf.app.
   ```
3. **Verify Domain and TLS Certificate Status**

   Return to [dash.shaf.app/dashboard/settings/domains](https://dash.shaf.app/dashboard/settings/domains) and click **Verify DNS**.

   Shaf resolves global Anycast DNS records and provisions an SSL/TLS 1.3 edge certificate via Google Trust Services or Let's Encrypt.

   **Expected output:**
   The domain card updates to active status:

   ```text
   Hostname Status:  Active
   SSL / TLS Status: Active (TLS 1.3)
   Certificate Authority: Google Trust Services
   ```
4. **Configure Root and 404 Fallback Destinations**

   Click your verified domain in the list to access routing configurations:

   - **Root Redirect (`/`)**: Enter your primary website URL (`https://yourbrand.com`).
   - **404 Not Found Redirect**: Enter your fallback URL (`https://yourbrand.com/help`).

   Click **Save Settings**.

   **Expected output:**
   A verification notification appears confirming:

   ```text
   Domain settings updated successfully: root redirect and 404 fallback active.
   ```
5. **Publish and Test Your First Branded Link**

   Navigate to **Links** → click **Create Link**.

   - **Domain**: Select `link.yourbrand.com`.
   - **Slug**: `welcome`.
   - **Destination URL**: `https://github.com/meladhani01/shaf`.

   Click **Create Link**, then test the live resolution in your terminal:

   ```bash
   curl -I https://link.yourbrand.com/welcome
   ```

   **Expected output:**

   ```http
   HTTP/2 308 Permanent Redirect
   location: https://github.com/meladhani01/shaf
   cf-cache-status: HIT
   ```

---

## Next Steps

Explore advanced domain architectures and fallback policies:

- **Custom Domain DNS Deep Dive** — Configure apex domains, CNAME flattening, and CAA security records.
- **Reverse Proxy Subpath Routing** — Serve short links from an existing application path like `yourbrand.com/l/*`.
- **SSL & Certificate Lifecycle** — Understand auto-renewal intervals and troubleshoot pending certificate validation.
- **Team Collaboration** — Invite teammates to manage branded domains and links with role-based access control.

Source: https://shaf.app/docs/tutorials/custom-domain/index.mdx
