Configuring Custom Domains with Cloudflare
This guide will walk you through setting up a CNAME record in Cloudflare to use your custom domain with Tunnelwise.
Prerequisites
- A domain registered and managed through Cloudflare (free account is enough)
- Your Tunnelwise unique URL (e.g.,
your-tunnel.tunnelwise.io
) - Access to your Cloudflare dashboard
Step-by-Step Instructions
1. Access Your Cloudflare Dashboard
- Log in to your Cloudflare account
- Select the domain you want to configure from your dashboard
2. Navigate to DNS Settings
- Click on the DNS tab in the left sidebar
- You'll see the DNS management page with all your existing records
3. Create a New CNAME Record
- Click the Add record button
- Configure the record with the following settings:
Field | Value |
---|---|
Type | CNAME |
Name | Your subdomain (e.g., tunnel , dev , api ) |
Target | Your Tunnelwise URL (e.g., your-tunnel.tunnelwise.io ) |
TTL | Auto |
Important: Set the Proxy status to DNS only (gray cloud icon)
- Click the orange cloud icon to turn it gray
- This ensures traffic goes directly to Tunnelwise, not through Cloudflare's proxy
4. Save the Record
- Click Save to create the CNAME record
- The record will appear in your DNS records list
Verification
DNS Propagation
DNS changes typically take 5-10 minutes to propagate, but can take up to 48 hours in rare cases. You can check the propagation status using:
# Check if your CNAME is resolving correctly
dig your-subdomain.yourdomain.com CNAME
# Or using nslookup
nslookup your-subdomain.yourdomain.com
Testing Your Custom Domain
Once DNS has propagated:
- Open Tunnelwise
- Start a tunnel with your custom domain
- Visit
https://your-subdomain.yourdomain.com
in your browser - You should see your local application
Troubleshooting
Common Issues
1. Orange Cloud Warning
Problem: The proxy status is set to "Proxied" (orange cloud) instead of "DNS only" (gray cloud)
Solution: Click the orange cloud icon next to your CNAME record to change it to gray. Cloudflare's proxy interferes with Tunnelwise's tunneling.
2. Domain Not Resolving
Problem: Your custom domain doesn't load
Solution:
- Verify the CNAME record is correctly configured
- Check DNS propagation using online tools like whatsmydns.net
- Ensure there are no conflicting A or AAAA records for the same subdomain
Cloudflare-Specific Settings
SSL/TLS Mode
If you have SSL/TLS settings configured in Cloudflare:
- Go to SSL/TLS → Overview
- Ensure your SSL mode is compatible (Full or Flexible recommended)
- This only applies if you later decide to enable Cloudflare proxy
Page Rules
Cloudflare Page Rules don't apply when proxy is disabled (gray cloud), which is the required configuration for Tunnelwise.
Still Need Help?
If you encounter issues not covered in this guide:
- Check the Tunnelwise Documentation
- Review existing and closed issues on Github. If you can't find a related issue, feel free to open one
- Visit the Cloudflare Community for DNS-specific questions