DNS and Reverse Proxy
Route eligible web traffic through Cloudflare while keeping DNS, TLS, and origin boundaries clear.
The proxy status on a DNS record determines whether eligible HTTP or HTTPS traffic goes through Cloudflare or directly to the record target.
Choose the record mode
| Mode | DNS answer | Appropriate use |
|---|---|---|
| Proxied | Cloudflare anycast addresses | Public HTTP and HTTPS applications |
| DNS only | The origin address or CNAME target | Mail, domain verification, unsupported protocols, or a deliberate direct service |
Only eligible A, AAAA, and CNAME records can be proxied. MX, TXT, and other record types remain DNS-only. Non-HTTP services and unsupported ports need another product or architecture; changing the cloud icon does not turn every protocol into proxied traffic.
Prepare a DNS cutover
- Export and review the current zone.
- Remove stale records and identify every record that reveals an origin address.
- Lower TTLs at the current provider early enough for caches to expire.
- Recreate records and mark only eligible web hostnames as proxied.
- Validate mail, verification, certificate, and application records before changing nameservers.
- If DNSSEC is active, follow the provider migration sequence; a stale DS record can make the zone fail validation.
- After activation, enable DNSSEC and publish the new DS record at the registrar.
A proxied hostname should normally return Cloudflare addresses rather than the configured origin. Compare results from more than one resolver during a cutover.
Encrypt both connections
Cloudflare terminates the client connection and creates another connection to the origin. Use Full (strict) so the origin presents a valid, unexpired certificate matching the hostname.
The second command is appropriate only from an authorized network path. A Cloudflare Origin CA certificate is trusted for the Cloudflare-to-origin connection, not by ordinary browsers. If engineers need direct browser access during recovery, use a publicly trusted origin certificate or a separate protected access path.
Prevent origin bypass
Proxying hides the current origin in ordinary DNS answers, but old records, mail headers, certificates, and other services may still reveal it. Do not rely on obscurity.
- Allow inbound web traffic only from current Cloudflare IP ranges, or use Tunnel to remove public inbound access.
- Keep administrative ports on a separate private path.
- Review DNS-only records for addresses shared with the web origin.
- Rotate a previously exposed origin address when the hosting design permits it.
- Log
CF-Connecting-IPas the visitor address only after confirming the connection came through the trusted Cloudflare path.
Verify the request path
Then confirm at the origin that the request came from Cloudflare, the expected host was used, TLS validation succeeded, and the application saw the intended client context.