Skip to main content

Overview

Custom domains allow you to use your own branded domain (e.g., go.yourcompany.com) instead of Dub’s default domains for your short links. This builds trust, strengthens brand recognition, and provides complete control over your link infrastructure.

Why Use Custom Domains?

Brand Recognition

Use your own domain to reinforce your brand with every link you share

Trust & Credibility

Branded links are more trustworthy and have higher click-through rates

Professional Appearance

Show professionalism with consistent branding across all touchpoints

Complete Control

Own your link infrastructure and avoid dependency on third-party domains

Adding a Custom Domain

1

Navigate to Domains

Go to Settings → Domains in your workspace dashboard.
2

Click Add Domain

Click the “Add Domain” button to open the domain configuration modal.
3

Enter Your Domain

Enter your domain or subdomain (e.g., go.yourcompany.com).
4

Configure DNS

Add the required DNS records to your domain provider.
5

Verify Domain

Wait for DNS propagation and click “Verify” to confirm ownership.

DNS Configuration

If you’re using a subdomain like go.yourcompany.com, add a CNAME record:
Type: CNAME
Name: go
Value: cname.dub.co
TTL: 3600 (or your provider's default)

For Apex Domains

If you’re using an apex domain like yourshortdomain.com, add an A record:
Type: A
Name: @
Value: 76.76.21.21
TTL: 3600 (or your provider's default)
Apex domains cannot use CNAMEs due to DNS specifications. Use A records or consider using a subdomain instead.

Domain Verification

After adding DNS records:
  1. DNS propagation can take 5-72 hours (usually much faster)
  2. Check verification status in the Domains settings
  3. Dub automatically checks for verification every few minutes
  4. You’ll receive an email once verification is complete
The domain card will show:
  • ✅ Green checkmark when verified
  • ⏳ Yellow pending icon while waiting
  • ❌ Red X if verification fails

Domain Configuration

Primary Domain

Set a domain as your workspace’s primary domain:
1

Open Domain Settings

Click on the domain card in Settings → Domains.
2

Set as Primary

Toggle “Set as Primary Domain” to make it the default for new links.
// API Example: Set primary domain
await fetch('/api/domains/go.yourcompany.com', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ primary: true })
});
The primary domain is automatically selected when creating new links in the dashboard.

Domain Placeholder

Set a custom placeholder for random key generation:
// Example: Set custom placeholder
await fetch('/api/domains/go.yourcompany.com', {
  method: 'PATCH',
  body: JSON.stringify({
    placeholder: 'https://go.yourcompany.com/your-link'
  })
});

Expired URL Redirect

Set a default URL for expired links on this domain:
// Example: Set expired URL
await fetch('/api/domains/go.yourcompany.com', {
  method: 'PATCH',
  body: JSON.stringify({
    expiredUrl: 'https://yourcompany.com/link-expired'
  })
});
When a link expires without a link-specific expired URL, users are redirected here.

Not Found URL Redirect

Set a default URL for non-existent links on this domain:
// Example: Set 404 redirect
await fetch('/api/domains/go.yourcompany.com', {
  method: 'PATCH',
  body: JSON.stringify({
    notFoundUrl: 'https://yourcompany.com'
  })
});
Without a notFoundUrl, visitors to non-existent links see a 404 page.
Upload a logo to customize QR codes for this domain:
  1. Open domain settings
  2. Click “Upload Logo”
  3. Select an image file (PNG, JPG, SVG)
  4. Logo will appear in QR codes for links using this domain
Configure automatic link cleanup for the domain:
// Example: Delete links older than 30 days
await fetch('/api/domains/go.yourcompany.com', {
  method: 'PATCH',
  body: JSON.stringify({
    linkRetentionDays: 30
  })
});

// Disable automatic deletion (default)
await fetch('/api/domains/go.yourcompany.com', {
  method: 'PATCH',
  body: JSON.stringify({
    linkRetentionDays: null
  })
});
Links older than the retention period are automatically deleted. This action is permanent and cannot be undone.
Individual links can opt out of retention cleanup:
// Disable cleanup for specific link
await fetch('/api/links/link_123', {
  method: 'PATCH',
  body: JSON.stringify({
    linkRetentionCleanupDisabledAt: new Date().toISOString()
  })
});

Registering Domains

Register new domains directly through Dub:
1

Search for Domain

In Domains settings, click “Register Domain” and search for availability.
2

Complete Purchase

Review pricing and complete the registration.
3

Auto-Configuration

DNS is automatically configured - no manual setup required.
4

Start Using

Domain is immediately ready for creating short links.

Auto-Renewal

Registered domains auto-renew annually by default:
// Disable auto-renewal
await fetch('/api/domains/yourshortdomain.com/renewal', {
  method: 'PATCH',
  body: JSON.stringify({
    autoRenewal: false
  })
});
You’ll receive email reminders before renewal. Default renewal fee is $12/year.
Configure Apple App Site Association for deep linking:
// Example: Set iOS deep linking configuration
await fetch('/api/domains/go.yourcompany.com', {
  method: 'PATCH',
  body: JSON.stringify({
    appleAppSiteAssociation: {
      applinks: {
        apps: [],
        details: [{
          appID: 'TEAM_ID.com.yourcompany.app',
          paths: ['*']
        }]
      }
    }
  })
});
This serves the required /.well-known/apple-app-site-association file. Configure Android asset links:
// Example: Set Android deep linking configuration
await fetch('/api/domains/go.yourcompany.com', {
  method: 'PATCH',
  body: JSON.stringify({
    assetLinks: [{
      relation: ['delegate_permission/common.handle_all_urls'],
      target: {
        namespace: 'android_app',
        package_name: 'com.yourcompany.app',
        sha256_cert_fingerprints: ['XX:XX:XX:...']
      }
    }]
  })
});
This serves the required /.well-known/assetlinks.json file.

Domain Transfer

Transfer domains between workspaces:
1

Initiate Transfer

Open domain settings and click “Transfer Domain”.
2

Select Workspace

Choose the destination workspace.
3

Confirm Transfer

Confirm the transfer - all links remain intact.
// API Example: Transfer domain
await fetch('/api/domains/go.yourcompany.com/transfer', {
  method: 'POST',
  body: JSON.stringify({
    newWorkspaceId: 'ws_new123'
  })
});
Only workspace owners can transfer domains. All links and analytics move with the domain.

Archiving Domains

Archive domains you no longer actively use:
// Archive a domain
await fetch('/api/domains/go.yourcompany.com', {
  method: 'PATCH',
  body: JSON.stringify({ archived: true })
});

// Unarchive
await fetch('/api/domains/go.yourcompany.com', {
  method: 'PATCH',
  body: JSON.stringify({ archived: false })
});
Archived domains and their links remain functional. They’re just hidden from the main domains list.

Deleting Domains

Permanently delete a domain:
1

Archive First

Consider archiving before deleting.
2

Backup Links

Export or migrate links to another domain if needed.
3

Delete Domain

Click “Delete” in domain settings and confirm.
// API Example: Delete domain
await fetch('/api/domains/go.yourcompany.com', {
  method: 'DELETE'
});
Deleting a domain does not delete its links. Links will show as having an invalid domain.

Domain Limits

Domain limits by plan:
  • Free: Use default Dub domains only
  • Pro: 3 custom domains
  • Business: 10 custom domains
  • Enterprise: Unlimited custom domains

API Reference

For detailed API documentation:

Best Practices

Use Subdomains

Prefer subdomains like go.yourcompany.com over apex domains for easier DNS management

Keep It Short

Choose short, memorable domains for better link readability

Set 404 Redirects

Configure notFoundUrl to provide a better experience for broken links

Enable HTTPS

Dub automatically provisions SSL certificates for all custom domains

Build docs developers (and LLMs) love