Skip to content
Tutorials Center
My learning

Topics

Lesson 7 of 36 ยท DNS and Proxying

Proxy Status: Orange Cloud vs Grey Cloud in Cloudflare

Learn what the orange cloud proxy does, what changes for visitors and your origin, which ports are proxied, how to hide the origin IP and when to use DNS only.

Next to each A, AAAA and CNAME record in the dashboard sits a cloud icon. Orange means Proxied, grey means DNS only. That single toggle decides whether visitors talk to your server directly or through Cloudflare's edge, and with it whether caching, the firewall, DDoS protection and Workers can touch the traffic. Understanding it removes most of the mystery from the product.

What the toggle changes

With DNS only, Cloudflare behaves like any DNS host. If www.example.com points at 203.0.113.10, a lookup returns 203.0.113.10 and browsers connect straight to your server.

With Proxied, a lookup returns Cloudflare addresses (from ranges such as 104.x, 172.67.x or IPv6 blocks), not your IP. The browser connects to the nearest edge, which applies its features and then opens its own connection to 203.0.113.10. The real address is still stored in the record; it just stops being published.

flowchart LR
  subgraph "DNS only (grey)"
    B1["Browser"] -->|"203.0.113.10"| O1["Origin"]
  end
  subgraph "Proxied (orange)"
    B2["Browser"] -->|"104.21.x.x"| E["Cloudflare edge"]
    E -->|"203.0.113.10"| O2["Origin"]
  end

The proxy replaces the published address and puts a full web stack in front of the origin.

What you gain from proxying

  • Caching and acceleration of static assets, HTTP/2 and HTTP/3 to browsers even if the origin speaks only HTTP/1.1.
  • TLS for visitors with a managed certificate, no work on the origin.
  • DDoS mitigation, WAF, rate limiting and bot defenses (chapter 4).
  • Rules and Workers that rewrite, redirect or answer requests.
  • Origin IP hiding, so attackers cannot bypass the protections by hitting the server directly.

What the proxy cannot do

Only HTTP and HTTPS traffic on supported ports passes through the free proxy. Typical proxied ports:

Protocol Ports
HTTP 80, 8080, 8880, 2052, 2082, 2086, 2095
HTTPS 443, 2053, 2083, 2087, 2096, 8443

Anything else, such as SSH (22), FTP, SMTP, a game server or a database, will fail on a proxied name, because the edge does not carry that protocol. Arbitrary TCP and UDP can be proxied with the separate Spectrum product on paid plans, and private services with Tunnel (chapter 7).

Other consequences:

  • The origin sees the edge's IP as the client. The visitor's real address arrives in the CF-Connecting-IP header (and X-Forwarded-For). Configure your web server or framework to read it, or logs and rate limiters will show Cloudflare addresses.
  • Request size limits apply (for example 100 MB uploads on the Free and Pro plans; higher on others).
  • There is a hard timeout waiting for the origin's first response (about 100 seconds by default); longer jobs should respond early or use background processing.
  • Proxied hostnames always show an automatic TTL.

Which records should be orange?

A simple decision rule:

  • Website and API hostnames served over HTTP(S): orange.
  • Mail hostnames (mail.example.com, the target of MX records): grey.
  • SSH, FTP, VPN endpoints, game servers, databases: grey (and think hard about exposing them at all).
  • Records used only for verification or ownership: grey.

A frequent trap: mail.example.com is proxied, mail stops flowing, and nobody notices for days. Another: an MX record pointing at example.com, which is orange, leaks nothing but also fails because mail cannot use the proxy.

JS Stand-in: what does a lookup return?

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The SSH name fails because it is orange. Making it grey (and restricting access some other way) restores it.

Keeping the origin IP secret

Proxying only helps if attackers cannot learn the real IP. Ways it leaks:

  • A grey-cloud record pointing to the same server (such as mail or direct).
  • Old DNS history from before you joined Cloudflare, available in public archives.
  • Outbound mail from the server, whose headers contain its IP.
  • Servers that reply on any hostname, so scanning the internet finds the site by IP.

Mitigations: use a different IP for mail (or a mail provider), allow inbound HTTP only from Cloudflare's published IP ranges in your firewall, enable Authenticated Origin Pulls (mutual TLS between edge and origin), or better, use Cloudflare Tunnel so the origin has no public inbound port at all. If the IP has leaked, change it.

Restoring the visitor IP

Because the origin sees edge addresses, use the real-IP module of your server. For nginx:

NGINX
# Trust Cloudflare's published ranges (list them from the official page)
set_real_ip_from 173.245.48.0/20;
real_ip_header CF-Connecting-IP;

Only trust the header when the connection really comes from Cloudflare's ranges, otherwise anyone can forge it.

JS Stand-in: trust CF-Connecting-IP safely

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does an orange-cloud A record publish in DNS?

    The origin IP stays in the dashboard record; visitors receive edge addresses.
  2. 2. Which service will break if its hostname is proxied through the free Cloudflare proxy?

    Only HTTP(S) on supported ports passes through; SSH needs DNS only or another product.
  3. 3. How does the origin learn the visitor's real IP behind the proxy?

    Cloudflare adds CF-Connecting-IP; verify the connection comes from Cloudflare before trusting it.
  4. 4. Which record should normally be grey-cloud?

    Mail delivery does not use the HTTP proxy, so the mail host must resolve to the real IP.

Summary

  • Orange = proxied (edge in front, origin IP hidden); grey = DNS only (direct).
  • The free proxy carries HTTP(S) on a fixed list of ports; other protocols need grey cloud, Spectrum or Tunnel.
  • The origin sees edge IPs; read CF-Connecting-IP from trusted ranges.
  • Protect the origin: avoid grey records to the same IP, firewall to Cloudflare ranges, use Authenticated Origin Pulls or Tunnel.

Next: DNSSEC, SPF, DKIM and DMARC