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:
OwnerorAdminrole 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.comoracme.link).
Implementation Recipe
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" } }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 CNAMEgo(or chosen subdomain)cname.shaf.app300(5 minutes)- Open the Cloudflare Dashboard and select your zone.
- Navigate to DNS → Records → click Add record.
- Select Type:
CNAME. - Enter Name:
go. - Enter Target:
cname.shaf.app. - Toggle Proxy status to DNS only (Grey Cloud).
- Click Save.
- Open the AWS Route 53 console and navigate to Hosted zones.
- Select your hosted zone and click Create record.
- Enter Record name:
go. - Choose Record type:
CNAME. - In Value, enter
cname.shaf.app. - Set TTL (seconds):
300. - Click Create records.
- Go to your Namecheap Domain List and click Manage next to your domain.
- Select the Advanced DNS tab.
- In the Host Records section, click Add New Record.
- Select Type:
CNAME Record. - Enter Host:
go. - Enter Target:
cname.shaf.app. - Set TTL:
5 minorAutomatic. Click the green checkmark to commit.
- In the GoDaddy control center, navigate to Domains → Manage DNS.
- Click Add New Record.
- Select Type:
CNAME. - Enter Name:
go. - Enter Value:
cname.shaf.app. - Set TTL:
1/2 Hour. - Click Save.
Add Ownership TXT Record (Apex Domains Only)
When routing an apex domain (e.g.,
acme.linkwithout 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.linkProvided token ( shaf-verify=...)300Trigger 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:
-
Inspect DNS resolution using
dig:dig CNAME go.acme.com +shortExpected output:
cname.shaf.app. -
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. |