# Custom Domains

Run your AVCodex agent on your own domain instead of the default `app.avcodex.com` URL. Useful when you want clients reaching your agent at `support.yourintegrator.com` or `roomhelp.yourbrand.com` rather than a generic platform URL.

---

Replace `your-agent.app.avcodex.com` with `chat.yourintegrator.com`, `roomhelp.yourbrand.com`, or whatever subdomain fits your brand. Custom domains make the agent feel like a native part of your integrator portal, your managed-services offering, or your client-facing room support.

> **Note:** Custom domains require a Builder plan or higher.

## Why a Custom Domain Matters

| Benefit | Description |
|---------|-------------|
| **Brand consistency** | Clients stay on your integrator's domain, not a third-party host |
| **Trust** | Programmers, end users, and procurement teams see a familiar URL |
| **Professionalism** | No platform branding in the URL when sharing with end-clients |
| **Cookies** | A subdomain of your main site keeps cookies same-site, which fixes cross-origin chat-history issues in iframe embeds |

## Prerequisites

Before setting up a custom domain:

- Builder plan or higher subscription
- Ownership or control of a domain name
- Access to your domain's DNS settings
- A published AVCodex agent

## Setting Up a Custom Domain

**1. Add the DNS Record First**

Before configuring inside AVCodex, add this CNAME record at your domain registrar:

| Type | Name | Value |
|------|------|-------|
| CNAME | `chat` (or your subdomain) | `fallback.app.avcodex.com` |

After you register the domain in AVCodex (Step 4), you'll also add a second DNS record for SSL validation. AVCodex will show you the exact record to add.

> **Tip:** Use a subdomain (like `chat.` or `roomhelp.`) rather than your root domain. Keeps your main website separate, simplifies DNS, and avoids interfering with email or other services on the apex domain.

**2. Open Settings**

Go to your agent's **Settings** page. You'll see the Custom Domain card.

**3. Enter Your Domain**

Type your subdomain in the input field:

```
chat.yourintegrator.com
```

Do not include `https://` or `www.`.

**4. Click Add**

AVCodex verifies your DNS configuration. If the CNAME record is found and points to `fallback.app.avcodex.com`, your domain is added.

After registration, AVCodex shows a second DNS record needed for SSL validation. Add this record at your registrar to activate HTTPS.

## DNS Configuration by Provider

### Cloudflare

1. Go to your domain's DNS settings.
2. Click **Add Record**.
3. Select **CNAME**.
4. Name: your subdomain (e.g. `chat`).
5. Target: `fallback.app.avcodex.com`.
6. Proxy status: **DNS only** (gray cloud).

> **Warning:** Disable Cloudflare's proxy (orange cloud) for the subdomain. Use "DNS only" mode. Custom domains will not provision SSL behind Cloudflare's proxy.

### GoDaddy

1. Go to **My Products** > **DNS**.
2. Click **Add** under Records.
3. Type: **CNAME**.
4. Name: your subdomain.
5. Value: `fallback.app.avcodex.com`.
6. TTL: 1 Hour.

### Namecheap

1. Go to **Domain List** > **Manage**.
2. Click **Advanced DNS**.
3. Add new record:
   - Type: **CNAME**
   - Host: your subdomain
   - Value: `fallback.app.avcodex.com`

### Google Domains / Squarespace Domains

1. Go to **DNS** in the sidebar.
2. Scroll to **Custom records**.
3. Create new record:
   - Name: your subdomain
   - Type: **CNAME**
   - Data: `fallback.app.avcodex.com`

### Route 53 (AWS)

1. Go to **Hosted Zones** > your domain.
2. Click **Create Record**.
3. Record name: your subdomain.
4. Record type: **CNAME**.
5. Value: `fallback.app.avcodex.com`.

## Verifying Your Setup

### Check DNS Propagation

Use these tools to verify your DNS is configured:

- [dnschecker.org](https://dnschecker.org)
- [whatsmydns.net](https://whatsmydns.net)

Enter your full domain (e.g. `chat.yourintegrator.com`) and confirm CNAME records point to `fallback.app.avcodex.com`.

### Test Your Domain

Once DNS propagates:

1. Visit your custom domain in a browser.
2. You should see your AVCodex agent.
3. Check the SSL certificate (padlock icon).

## Troubleshooting

### "Could not find CNAME record"

1. **Wait for propagation**: DNS can take up to 48 hours (usually minutes).
2. **Check record type**: Must be CNAME.
3. **Check target**: Should be exactly `fallback.app.avcodex.com`.

### "CNAME record does not match"

Your CNAME is pointing somewhere else. Update it to point to `fallback.app.avcodex.com`.

### "Custom domain is already in use"

Another AVCodex agent is using this domain. Each domain can only be used by one agent.

### Domain Not Working After Adding

1. **Remove proxy**: If using Cloudflare, disable proxy (use DNS only).
2. **Check DNS**: Verify the CNAME target is correct.
3. **HTTPS required**: Access via `https://`, not `http://`.

## Removing a Custom Domain

To remove a custom domain:

1. Go to **Settings**.
2. Click the trash icon next to your domain.
3. Your agent reverts to the default `your-agent.app.avcodex.com` URL.

After removing, also delete the DNS record at your registrar.

## Best Practices

### Subdomain Naming

Pick a subdomain that maps to how AV pros and clients will think about it:

| Good | Why |
|------|-----|
| `chat.integrator.com` | Clear, generic |
| `roomhelp.brand.com` | Aimed at end users in conference rooms (works well on QR-code support stickers) |
| `ai.integrator.com` | Short, memorable for internal teams |
| `support.brand.com` | Reads as a managed-services offering |
| `programmer.integrator.com` | Internal tool for AV programmers and field techs |

### Backup Access

Keep your default `your-agent.app.avcodex.com` URL bookmarked as a backup in case of DNS issues.

*AVCodex · Your AV expertise. Amplified by AI.*
