Skip to content

Configuring Custom Domain DNS Records

Route branded custom domain and subdomain traffic to Shaf Anycast edge nodes via CNAME and TXT verification records.

Configuring Custom Domain DNS Records

Custom short links require domain verification and Anycast routing before serving production traffic. This guide configures canonical DNS records across major registrars to achieve verified domain status and automatic TLS termination on Shaf’s global edge.


Prerequisites

  • Workspace permissions: Owner or Admin role in your Shaf organization.
  • Administrative access to your DNS provider or zone manager (Cloudflare, AWS Route 53, Namecheap, GoDaddy).
  • A domain or subdomain designated for short links (for example, go.acme.com or acme.link).

Implementation Recipe

  1. Register Domain in Shaf

    Navigate to dash.shaf.app/dashboard/settings/domains and click Add Domain, or dispatch a request via the REST API (see Domains API Reference):

    curl -X POST "https://shaf.app/api/v1/domains" \
      -H "Authorization: Bearer $SHAF_API_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "hostname": "go.acme.com"
      }'

    Expected response (201 Created):

    {
      "id": "dom_01j8k3m4n5p6q7r8s9t0",
      "hostname": "go.acme.com",
      "status": "pending_dns",
      "target": "cname.shaf.app",
      "verification": {
        "type": "CNAME",
        "name": "go.acme.com",
        "value": "cname.shaf.app"
      }
    }
  2. Add DNS CNAME Record

    In your DNS management console, create a CNAME record mapping your subdomain prefix to Shaf’s edge gateway:

    Type Name / Host Target / Value TTL
    CNAME go (or chosen subdomain) cname.shaf.app 300 (5 minutes)
    1. Open the Cloudflare Dashboard and select your zone.
    2. Navigate to DNS → Records → click Add record.
    3. Select Type: CNAME.
    4. Enter Name: go.
    5. Enter Target: cname.shaf.app.
    6. Toggle Proxy status to DNS only (Grey Cloud).
    7. Click Save.
    1. Open the AWS Route 53 console and navigate to Hosted zones.
    2. Select your hosted zone and click Create record.
    3. Enter Record name: go.
    4. Choose Record type: CNAME.
    5. In Value, enter cname.shaf.app.
    6. Set TTL (seconds): 300.
    7. Click Create records.
    1. Go to your Namecheap Domain List and click Manage next to your domain.
    2. Select the Advanced DNS tab.
    3. In the Host Records section, click Add New Record.
    4. Select Type: CNAME Record.
    5. Enter Host: go.
    6. Enter Target: cname.shaf.app.
    7. Set TTL: 5 min or Automatic. Click the green checkmark to commit.
    1. In the GoDaddy control center, navigate to Domains → Manage DNS.
    2. Click Add New Record.
    3. Select Type: CNAME.
    4. Enter Name: go.
    5. Enter Value: cname.shaf.app.
    6. Set TTL: 1/2 Hour.
    7. Click Save.
  3. Add Ownership TXT Record (Apex Domains Only)

    When routing an apex domain (e.g., acme.link without a subdomain prefix), DNS specifications prevent root CNAME records without flattening. Add the ownership verification TXT record generated in your dashboard:

    Type Name / Host Value TTL
    TXT _cf-custom-hostname.acme.link Provided token (shaf-verify=...) 300
  4. Trigger Domain Verification

    Trigger validation from the dashboard by clicking Verify DNS, or invoke the verification endpoint:

    curl -X POST "https://shaf.app/api/v1/domains/dom_01j8k3m4n5p6q7r8s9t0/verify" \
      -H "Authorization: Bearer $SHAF_API_TOKEN"

Verification

Query public DNS and test edge reachability:

  1. Inspect DNS resolution using dig:

    dig CNAME go.acme.com +short

    Expected output:

    cname.shaf.app.
  2. Send an HTTP probe to inspect edge response headers:

    curl -I "https://go.acme.com"

    Expected headers:

    HTTP/2 308 Permanent Redirect
    server: cloudflare
    x-shaf-edge: HIT

Common Gotchas

Error / Symptom Root Cause Resolution
Cloudflare Error 1000 Proxy status is set to Proxied (Orange Cloud) in Cloudflare DNS. Toggle Proxy status to DNS only (Grey Cloud) on your CNAME record.
Status remains pending_dns Local or upstream DNS resolver has not refreshed record TTL. Run dig +trace CNAME go.acme.com to verify authoritative propagation; wait 5–15 minutes.
Apex CNAME rejected by registrar RFC 1912 forbids CNAME records on zone apex (@). Use an ALIAS or ANAME record, or enable CNAME flattening at Cloudflare / Route 53.
SSL Handshake Failed (Error 525) Edge TLS certificate has not finished issuance. Wait 2–3 minutes for Let’s Encrypt / Cloudflare for SaaS certificate issuance to complete.

Type to search…

↑↓ navigate↵ selectEsc close