Skip to content

Bind a Custom Domain

After deploying, you need to point your own domain at the deployment platform so that email tracking links use your own domain.

DNS flexibility across the four platforms:

PlatformDNS requirementConnection method
Cloudflare WorkersEntire zone must be hosted on CFNS-level
VercelAny DNS providerCNAME
NetlifyAny DNS providerCNAME
Deno DeployAny DNS providerCNAME

Cloudflare Worker

Prerequisite: your domain is already hosted on Cloudflare (DNS at Cloudflare).

Best for: dedicating a subdomain (e.g., track.yourdomain.com) to tracking.

  1. Open Cloudflare Dashboard → select your domain
  2. Left sidebar DNSRecords → Add record
    • Type: AAAA
    • Name: track (or any subdomain you want)
    • IPv6 address: 100:: (placeholder, Worker handles all requests)
    • Proxy status: Proxied (orange cloud must be on)
  3. Left sidebar Workers Routes → Add route
    • Route: track.yourdomain.com/*
    • Worker: select the just-deployed email-track-domain
  4. Takes effect within minutes. Visit https://track.yourdomain.com/r/test to verify it reaches your backend.

Option B: Worker Custom Domain (simpler)

Best for: binding a Workers project directly to a domain (Cloudflare handles DNS and SSL automatically).

  1. Open Workers Dashboard → select email-track-domain Worker
  2. SettingsTriggersCustom Domains → Add Custom Domain
  3. Enter track.yourdomain.com, confirm
  4. Cloudflare auto-creates DNS records and issues an SSL certificate

Difference: Option A is flexible (can route specific paths), Option B binds the whole domain (simpler). Most users should pick B.


Vercel

  1. Open Vercel Dashboard → select project → SettingsDomains
  2. Enter track.yourdomain.com, Add
  3. Vercel will show the DNS record you need to add at your DNS provider, similar to:
    Type: CNAME
    Name: track
    Value: cname.vercel-dns.com
  4. After adding DNS, wait a few minutes for Vercel to auto-issue the SSL certificate

Netlify

  1. Open Netlify Dashboard → select site → Domain managementCustom domainsAdd a domain
  2. Enter track.yourdomain.comVerifyYes, add domain
  3. Netlify shows the DNS records to add at your DNS provider:
    Type: CNAME
    Name: track
    Value: <your-site>.netlify.app
  4. Wait for SSL to be issued (minutes to 24 hours)

Deno Deploy

  1. Open dash.deno.com → select project → SettingsDomainsAdd Domain
  2. Enter track.yourdomain.com, Deno Deploy gives two records:
    Type: A      Name: track  Value: <your-IPv4>   (example, use the actual value)
    Type: AAAA   Name: track  Value: ...           (IPv6)
    Or use CNAME:
    Type: CNAME  Name: track  Value: <project>.deno.dev
  3. Add the DNS records, then return to Deno Deploy and click Verify
  4. SSL is issued automatically

Verification

After deployment + binding, visit in your browser:

URLExpected behavior
https://track.yourdomain.com/302 redirect to google.com (root not in allowlist)
https://track.yourdomain.com/test.php302 redirect to google.com (blocked extension)
https://track.yourdomain.com/r/abc123Forwarded to your backend (allowed path)
https://track.yourdomain.com/favicon.icoForwarded to your backend (allowed root file)

If the third one returns 502 "Backend fetch failed", BACKEND_HOST is misconfigured or the backend is unreachable.


Using in emails

Replace all tracking links in your emails that pointed to cf-track.laifa.xin with track.yourdomain.com. For example:

Old: http://cf-track.laifa.xin/r/abc123
New: https://track.yourdomain.com/r/abc123

Open/click statistics still flow to your original backend, but recipients see your own domain — more professional, and improves your anti-spam score.