Cloudflare DNS Migration Guide
Migrate freebeer.ai DNS to Cloudflare for 100% automated DNS management
Timeline: 30 minutes of work + 24-48 hours DNS propagation
Status: Production-ready
Prerequisites
- Access to GoDaddy account (freebeer.ai registrar)
- Access to SiteGround account (current DNS host)
- Email address for Cloudflare account
- Test domain for practice (optional but recommended)
Part 1: Practice with Test Domain (Optional)
Why Practice First?
- Gain confidence with the process
- Understand what happens during migration
- No risk to production freebeer.ai domain
- Can test DNS changes without affecting live sites
Part 2: Cloudflare Account Setup
Step 1: Create Cloudflare Account
- Go to: https://dash.cloudflare.com/sign-up
- Enter email address
- Create password
- Verify email (check inbox for verification link)
- Log in to Cloudflare dashboard
Checkpoint: You should see empty Cloudflare dashboard with "Add a Site" button
Step 2: Add freebeer.ai Domain
- Click "Add a Site" button
- Enter domain:
freebeer.ai - Click "Add site"
- Choose plan: Free (scroll down, it's at the bottom)
- Click "Continue"
Cloudflare will now scan your existing DNS records from SiteGround (~60 seconds).
Step 3: Review DNS Records
Cloudflare will display all DNS records it found. IMPORTANT: Review carefully!
Expected records for freebeer.ai:
Type: A
Name: @ (or freebeer.ai)
Content: [SiteGround IP address]
TTL: Auto
Type: CNAME
Name: www
Content: freebeer.ai
TTL: Auto
Type: CNAME
Name: dev
Content: cname.vercel-dns.com
TTL: Auto
Type: CNAME
Name: staging
Content: cname.vercel-dns.com
TTL: Auto
Type: CNAME
Name: app
Content: cname.vercel-dns.com
TTL: Auto
... (any other records you have)
What to do:
- Review each record - make sure nothing is missing
- Check the three Vercel CNAMEs are present (dev, staging, app)
- If any records are missing, note them down
- Click "Continue"
Step 4: Get Nameserver Information
Cloudflare will show you two nameservers to use. They'll look like:
bella.ns.cloudflare.com
kurt.ns.cloudflare.com
Don't click "Done" yet - keep this page open in a browser tab.
Part 3: Update Nameservers at GoDaddy
Step 5: Log into GoDaddy
- Go to: https://www.godaddy.com
- Log in to your account
- Click "My Products"
- Find freebeer.ai in your domain list
- Click "DNS" or "Manage DNS"
Step 6: Change Nameservers
- Scroll down to "Nameservers" section
- Click "Change" or "Manage"
- Select "Custom" or "Enter my own nameservers"
Current nameservers (SiteGround - you're replacing these):
ns1.siteground.com
ns2.siteground.com
(or similar)
New nameservers (Cloudflare - from Step 4):
bella.ns.cloudflare.com
kurt.ns.cloudflare.com
(use the exact names Cloudflare gave you)
- Remove old SiteGround nameservers
- Add new Cloudflare nameservers (both of them)
- Click "Save"
This is normal. Click "Continue" or "Yes".
Step 7: Confirm in Cloudflare
- Go back to Cloudflare tab
- Click "Done, check nameservers"
Expected result: One of two things will happen:
Option A: "Great! We detected your nameservers"
- Cloudflare immediately sees the change
- You're done! Skip to Step 8
Option B: "We haven't detected your nameservers yet"
- Normal! DNS propagation takes time
- Cloudflare will send you email when detected
- Continue to Step 8
Part 4: Wait for DNS Propagation
Step 8: Monitoring Propagation
What's happening:
- GoDaddy has updated nameservers
- DNS servers worldwide are caching old nameservers
- Takes 24-48 hours for all servers to see new nameservers
How to Check Progress
Method 1: Cloudflare Dashboard
- Log into Cloudflare
- Check freebeer.ai status
- Will show "Active" when fully migrated
Method 2: Command Line
# Check what nameservers are being returned
dig NS freebeer.ai
# Should eventually show:
# freebeer.ai. 86400 IN NS bella.ns.cloudflare.com.
# freebeer.ai. 86400 IN NS kurt.ns.cloudflare.com.
Method 3: Online Tool
- Visit: https://www.whatsmydns.net
- Enter:
freebeer.ai - Type:
NS - Check: Should see Cloudflare nameservers propagating globally
Timeline:
| Time | Status |
|---|---|
| 0-6 hours | Partial propagation |
| 6-24 hours | Most servers updated |
| 24-48 hours | Full global propagation |
Step 9: Verify Existing Sites Still Work
After propagation completes (Cloudflare shows "Active"):
Test each of your existing sites:
# Test main domain
curl -I https://freebeer.ai
# Should return: 200 OK
# Test PAI Dashboard environments
curl -I https://dev.freebeer.ai
curl -I https://staging.freebeer.ai
curl -I https://app.freebeer.ai
# All should return: 200 OK
In browser: Visit each URL and confirm sites load normally.
- Clear browser cache (Cmd+Shift+R on Mac)
- Wait another 12 hours for DNS to fully propagate
- Check Cloudflare DNS records match SiteGround records
Part 5: Cloudflare Configuration
Step 10: SSL/TLS Settings
- Go to Cloudflare dashboard → freebeer.ai
- Click "SSL/TLS" in left sidebar
- Under "Overview", select: "Full (strict)"
Why: Your sites already have SSL from Vercel. This setting ensures Cloudflare's SSL works with Vercel's SSL.
Step 11: Enable Auto-Minify (Optional)
For better performance:
- Go to: Speed → Optimization
- Enable Auto Minify for:
- JavaScript
- CSS
- HTML
- Save
Step 12: Security Settings (Optional)
Default settings are fine, but you can enhance:
- Go to: Security → Settings
- Security Level: Medium (default)
- Challenge Passage: 30 minutes (default)
- Browser Integrity Check: ON (recommended)
Part 6: Get Cloudflare API Token
Step 13: Create API Token for Automation
This enables the automation script to manage DNS programmatically
- Go to: Cloudflare Dashboard → Profile (top right)
- Click "API Tokens"
- Click "Create Token"
- Find template: "Edit zone DNS"
- Click "Use template"
Configure token:
- Permissions: Zone / DNS / Edit ✓
- Zone Resources:
- Include / Specific zone /
freebeer.ai
- Include / Specific zone /
- IP Address Filtering: (leave blank for now)
- Click "Continue to summary"
- Review permissions
- Click "Create Token"
Cloudflare API Token: [long string starting with underscore]
Save this token: You'll add it to your environment variables:
# Add to ~/.zshrc
export CLOUDFLARE_API_TOKEN="your_token_here"
Also get your Zone ID:
- Go back to Cloudflare dashboard
- Click on freebeer.ai domain
- Scroll down on Overview page
- Find "Zone ID" on the right side
- Copy it
# Add to ~/.zshrc
export CLOUDFLARE_ZONE_ID="your_zone_id_here"
Part 7: Test API Access
Step 14: Verify API Token Works
# Source your .zshrc to load new variables
source ~/.zshrc
# Test API access
curl -X GET "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/dns_records" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json"
Expected result: JSON response listing all your DNS records
Part 8: Add Client Subdomain Pattern (Test)
Step 15: Test Adding a Client Subdomain via API
Let's test the automation by adding a test client subdomain:
# Add a test dev subdomain
curl -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/dns_records" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "CNAME",
"name": "test-client.dev",
"content": "cname.vercel-dns.com",
"ttl": 300,
"proxied": false
}'
Expected result: JSON response with "success": true
Verify in Cloudflare dashboard:
- Go to: DNS → Records
- Look for:
test-client.devCNAME record - Should point to:
cname.vercel-dns.com
Test it works:
dig test-client.dev.freebeer.ai
# Should show:
# test-client.dev.freebeer.ai. 300 IN CNAME cname.vercel-dns.com.
Clean up the test record (via Cloudflare dashboard or API):
# List records to find the ID
curl -X GET "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/dns_records?name=test-client.dev.freebeer.ai" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
# Delete using the record ID from response
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/dns_records/[RECORD_ID]" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
Completion Checklist
- Cloudflare account created
- freebeer.ai added to Cloudflare
- All DNS records reviewed and confirmed
- Nameservers updated at GoDaddy
- DNS propagation complete (24-48 hours)
- All existing sites verified working
- SSL/TLS set to "Full (strict)"
- API token created and saved
- Zone ID saved
- Environment variables added to ~/.zshrc
- API access tested successfully
- Test subdomain created and verified via API
Troubleshooting
"Sites not loading after migration"
Check:
- DNS propagation complete? (use whatsmydns.net)
- SSL mode set to "Full (strict)"? (Cloudflare dashboard)
- All DNS records copied correctly? (compare SiteGround vs Cloudflare)
Fix: Wait longer (up to 48 hours) or clear browser cache
"API token not working"
Check:
- Token copied correctly? (no extra spaces)
- Zone ID correct?
- Token has "Edit zone DNS" permission?
Fix: Create new token, ensure permissions are correct
"Cloudflare shows nameservers not detected"
Check:
- Nameservers updated at GoDaddy? (check GoDaddy dashboard)
- Correct Cloudflare nameservers used? (check Cloudflare setup page)
Fix: Wait 24-48 hours, Cloudflare checks periodically
Next Steps
Once Cloudflare migration is complete:
- ✅ Phase 1 complete!
- → Proceed to Phase 2: Create client template repository
- → Build automation script that uses Cloudflare API