From a URL to a Reachable Server
A URL is not an address. You type the store URL and press Enter, but nothing in that string says where a server is: the host is only a name, the path only names a resource, and the scheme only promises protection. Two systems act first — one turns the name into an address, the other carries HTTP to whatever answers.
Think of mailing a letter to "the bakery on Main Street." The name is memorable but not routable; a directory maps it to a street address, and a postal system carries the envelope. If the bakery moves, the directory changes but the name does not.
Vocabulary:
- DNS is the directory mapping names to records such as IP addresses. DNS hosting is whoever runs the zone's authoritative nameservers, independent of proxying.
- HTTP is the request/response protocol: a method and path go out; status, headers, and a body come back.
- The origin is the server holding your application and data, the part you operate.
- HTTP proxying puts a reverse proxy — a server in front of an origin — on the path of web traffic, so visitors never need the origin's address. The edge is a nearby proxy location, and edge code such as Workers runs inside it.
The model is four steps: resolve, connect, exchange HTTP, and return. The browser checks its cache, then the OS cache, then a recursive resolver that walks from the root to the .com servers to the authoritative nameservers. A normal record returns your origin's IP; a proxied one returns a Cloudflare anycast address.
DNS and HTTP have separate lifetimes
A proxied DNS answer is cached for 300 seconds, while every request is a fresh edge decision. The browser also sends the hostname in the SNI extension during the TLS handshake, so the edge can pick the right certificate even though many names share one anycast address; HTTP only becomes visible after that handshake.
Figure 1 traces the hops and where trust changes hands.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
subgraph CLIENT["Client boundary"]
B["Browser: https://shop.example.com/cart"]
end
subgraph DNSS["DNS control plane"]
R["Recursive resolver"] --> A["Authoritative NS: A, AAAA, or CNAME"]
end
subgraph EDGE["Cloudflare edge boundary"]
P["Anycast address, TLS terminates"] --> C{"Cache HIT?"}
C -->|"yes"| E["Edge response"]
C -->|"no"| S["WAF, Worker, cache fill"]
end
subgraph ORIGIN["Origin boundary"]
O["Origin 203.0.113.10 port 443"]
end
B -->|"1 hostname lookup"| R
A -->|"2 address answer"| B
B -->|"3 HTTPS request"| P
S -->|"4 fetch with CF-Connecting-IP"| O
O -->|"5 response and headers"| S
E --> B
S --> B
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class S,O primary;
class B,R,A,P secondary;
class C,E ok;
Figure 2 redraws the journey as layers; each boundary is where a party sees the request, decides, or fails.
What Changes When Cloudflare Proxies a Hostname
In the default full setup, Cloudflare becomes the authoritative DNS provider: the registrar's nameservers are replaced and Cloudflare answers every query for the zone. That alone puts nothing in front of your server. Proxying is a separate per-record switch, shown as an orange cloud; only A, AAAA, and CNAME records used for address resolution are eligible, while MX and TXT stay DNS-only.
The grey/orange toggle changes two things at once: the DNS answer and whether HTTP passes through the edge. A grey cloud returns the origin address and sends clients directly to your server. An orange cloud returns a Cloudflare anycast address and puts the edge in the path before the origin. The figure below shows both answers and paths.
Read the record, then the path. With the zone delegated to Cloudflare, three records can behave three ways:
Queries for www return Cloudflare anycast addresses, so HTTP passes through the edge where cache, WAF, and Workers can act. mail resolves straight to the origin, and SMTP never touches Cloudflare because the proxy only handles HTTP and HTTPS.
| Concern | DNS-only (grey cloud) | Proxied (orange cloud) | Who owns the decision |
|---|---|---|---|
| DNS answer | Origin IP | Cloudflare anycast IPs | Record and proxy status |
| TLS termination | At your origin | At the edge, then again to the origin | SSL/TLS mode and origin cert |
| Cache, WAF, Workers | Not applied | Applied per zone rules and plan | Zone configuration and entitlements |
| Effective TTL | Your TTL | Fixed Auto, 300 seconds | Cloudflare |
| Typical failure | The origin's error or timeout | 520, 521, 522, 524, or 526 from the edge | Whichever layer failed |
| Good fit | Email, verification, non-HTTP | Web traffic on A, AAAA, CNAME | Record by record |
Three boundaries follow. Cloudflare is not hosting your application merely because it proxies the hostname; the origin still runs your code and holds your data. The exception is a Worker with a custom domain, where the Worker is the origin and Cloudflare creates the DNS record and certificate. Proxying is HTTP-only; arbitrary TCP needs Spectrum or a DNS-only record.
Supported is not the same as included
The proxy and cache are available on every plan, but the Managed Ruleset, Argo, and longer proxy timeouts are not. Check the entitlement before you design around a feature.
Figure 3 follows one query through the proxy decision and its failure branches.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
Q["DNS query for shop.example.com"] --> PS{"Record proxied?"}
PS -->|"DNS-only"| IP["Answer: origin 203.0.113.10"]
IP --> D["Direct client-to-origin TLS, no cf-ray"]
PS -->|"Proxied"| ANY["Answer: Cloudflare anycast IP"]
ANY --> TLS["TLS handshake at nearest colo"]
TLS --> SEC{"WAF or rate limit blocks?"}
SEC -->|"yes"| BLOCK["Edge response, origin never contacted"]
SEC -->|"no"| HIT{"Cache HIT?"}
HIT -->|"yes"| SERVE["Serve from edge, cf-cache-status HIT"]
HIT -->|"no"| CONN{"Origin reachable?"}
CONN -->|"TCP fails at 19 s"| E522["522 connection timed out"]
CONN -->|"no response by 125 s"| E524["524 timeout"]
CONN -->|"untrusted certificate"| E526["526 invalid certificate"]
CONN -->|"yes"| RESP["Origin response plus cf-ray"]
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class IP,D,ANY,CONN primary;
class Q,PS,TLS secondary;
class BLOCK,HIT,SERVE,RESP ok;
class SEC,E522,E524,E526 danger;
Where Caching, Security, and Workers Fit
Once a request reaches the edge, independent systems can answer it before your origin sees anything. The useful question is not what Cloudflare does but which layer owns the decision, and what happens when it is wrong.
TLS ownership is clearest. The visitor's certificate and protocol are edge concerns; the edge-to-origin connection follows the SSL/TLS mode. Flexible speaks HTTPS to the visitor and HTTP to the origin, so encryption is partial and an origin redirecting HTTP to HTTPS loops. Full encrypts without validating the certificate; Full (strict) validates it.
Security rules own allow, block, and challenge. A WAF block ends the request at the edge: the client gets a response with a cf-ray, the origin log stays empty, and cache status is meaningless — a feature during an attack, a trap during a false positive.
Caching owns reuse and staleness. Cloudflare caches by file extension, not MIME type: CSS, JS, images, and fonts qualify; HTML and JSON do not. One of four statuses then reports what happened:
| Status | What it means | Which layer decided |
|---|---|---|
MISS | Eligible response was absent; the edge fetched the origin | Cache, after a lookup |
HIT | Response came from the edge | Cache |
DYNAMIC | Request is not cacheable under the current rules | Eligibility: extension or rule |
BYPASS | Eligible asset made uncacheable by origin headers | Origin headers or a bypass rule |
Workers own programmable behavior, and they run before the cache. A Worker can rewrite a request, enforce authentication, or answer without an origin fetch. Its response often reports none/unknown because the cache was never consulted, while its own fetch() creates a subrequest with its own status. Workers also have limits: 100,000 requests per day and 10 ms of CPU per request on Free, and 50 subrequests per invocation.
A composite scenario shows the layers interacting. A team launches a product page behind a Worker that checks a session cookie, and the origin saturates. Someone sees DYNAMIC, adds a Cache Rule making that path eligible for an hour, and origin load drops.
Then the cache key decides who sees what. An anonymous visitor receives another customer's name, because the cached page was rendered for a logged-in request and the key did not distinguish them. The fix is to cache only the anonymous variant, bypass when a session cookie is present, and keep auth in the Worker ahead of the lookup.
Caching HTML is a decision, not a default
Proxying a hostname does not make its HTML cacheable. Cloudflare caches by file extension and excludes HTML and JSON, so the first "cache everything" rule is often the moment HTML enters the cache — and the same rule can serve one visitor's personalized page to another unless the cache key or a bypass separates authenticated from anonymous requests.
The Same Request With and Without a Proxy
Start with the direct path. With DNS-only, the resolver returns the origin address and the browser connects straight to your server, where TLS terminates. Your log records the visitor's address, every request consumes origin capacity, and there is no cf-ray, cache, or WAF. A 200-second report still succeeds if the client waits, because nothing imposes a 125-second timeout; the tradeoff is exposure, since anyone who queries the name can aim at the origin.
Now proxy the record. The resolver returns a Cloudflare anycast address; TLS terminates at the edge, security rules and possibly a Worker run, and the cache is consulted. On a miss, Cloudflare opens a second connection to the origin with CF-Connecting-IP carrying the visitor's address.
That wait has limits. Missed TCP establishment at 19 seconds gives 522, no response within 125 seconds gives 524, and an untrusted certificate under Full (strict) gives 526. Your origin sees Cloudflare's address unless it reads the header or you use Authenticated Origin Pulls or a Tunnel.
Figure 4 compares the paths and their failure modes.
The tradeoffs are about where complexity lands. Proxying adds a hop, but it is usually the nearest data center: TLS ends there, origin connections are reused, and a cache hit removes the origin round trip. Uncacheable responses can be marginally slower on first byte. Edge protection also means logs, rate limits, and client-IP handling must adapt.
Hiding the origin is not protecting it
Obfuscation only helps if the origin is otherwise unreachable. A firewall open to the world makes the hidden address cosmetic.
Boundary conditions cause surprises. Multiple A or AAAA records on one name are all proxied if any is. A proxied record anywhere in a CNAME chain proxies the chain, and a CNAME into another Cloudflare account fails with 1014. Proxied records ignore your TTL and use 300 seconds. To isolate a layer, grey-clouding removes the edge and tells you whether the fault is yours, at the cost of exposing the origin.
Draw the Journey of a Request to Your Test Site
The lab traces the same path on a domain you control. It is design-only: the commands follow the cited documentation, and only the header sample in the next section was observed live.
Optionally, bind a Worker to the /api/* route on that hostname and return request.cf.colo, so the Worker step has something to compare.
Draw the Journey of a Request to Your Test Site
Execution status: design-only; not executed.
Prerequisites.
- A domain you can move to Cloudflare's nameservers, and a free account.
- cloudflared, or a small VPS, plus curl and dig.
- The Free plan covers DNS, proxying, cache, ten Cache Rules, and Workers at 100,000 requests per day with 10 ms CPU.
Steps. Run each step and read its pass condition.
- DNS answer. Run
dig +short lab.example.com: two or more Cloudflare anycast addresses, not 127.0.0.1. - Response headers. Run
curl -sSI https://lab.example.com/:server: cloudflare, acf-rayending in a three-letter colo code, andDYNAMICfor HTML. - Static asset. Request
/logo.svgtwice:MISSfirst, thenHITwith a growingage. - Cache Rule. Make
/index.htmleligible, purge, and repeat step 2:HITafter the first refill. Record the expression so you can remove it. - Worker route. Compare
request.cf.colowith thecf-raysuffix: both name the same data center. Expectnone/unknown, because no cache lookup occurred. - Grey cloud. Grey-cloud the record, wait 300 seconds plus local resolver cache, and repeat steps 1–2: the origin address appears and
cf-raydisappears. Re-enable the proxy. - Stopped origin. Stop the origin and request the page: an edge-generated 5xx naming Cloudflare, not your application.
Cost dimensions. Domain registration is typically USD 10–15 per year, registrar-dependent. The Free plan, tunnels, and this exercise's Workers volume are USD 0; Workers Paid starts at USD 5 per month.
Cleanup. Delete the tunnel route and DNS record, then the Worker route and script. Stop the server and remove the directory; do not leave a proxied record pointing at a tunnel that no longer exists.
Reading a failed lab run
- 526 — the origin certificate is untrusted under Full (strict).
- 524 — the 125-second read timeout was exceeded.
- Redirect loop — Flexible is fighting an origin HTTPS redirect.
- Repeated DYNAMIC on an asset — the asset is ineligible or bypassed by a rule.
- BYPASS — the origin sent Set-Cookie, no-store, or private.
- One origin address instead of anycast — the record is grey-clouded.
- Stopped origin — a tunnel returns a tunnel-specific error; a direct origin returns 521 or 522.
Identify Each Hop From DNS and Response Evidence
Two artifacts verify the journey. The DNS answer says whether the edge is in the path; the response headers say which data center answered, whether the cache was consulted, and whether the origin was reached. Read them as pairs:
| Artifact | Pass looks like | Fail looks like |
|---|---|---|
| DNS answer | Cloudflare anycast addresses from dig | One origin address: the record is grey-clouded |
| Response headers | server: cloudflare and a cf-ray with a plausible colo | No cf-ray: the proxy was bypassed or DNS is still cached |
| Static asset | MISS first, then HIT with a growing age | Repeated DYNAMIC: ineligible or bypassed by a rule |
| HTML | DYNAMIC until a rule opts it in | HIT on a page that should be personalized |
| Worker route | request.cf.colo matches the cf-ray suffix | A Worker that never runs: the record is grey-clouded |
A cf-ray on a name you expected to be DNS-only usually means a proxied CNAME chain, and a 522 or 524 with an empty origin log points at the edge-to-origin hop.
One live check confirms the shape. On 2026-11-04, against a Cloudflare-proxied host we do not control (curl 8.5.0, DiG 9.10.6, macOS 26.7.2):
The address answers were 104.16.5.189 and 104.16.2.189, and the zone's nameserver was ns3.cloudflare.com. That is a proxied name on Cloudflare addresses, Cloudflare nameservers, and a header-identified cache hit — documented behavior on a host we do not control, not a measurement of your origin.
Self-check.
- A proxied record resolves to a 104.16 address — where does TLS terminate? At the edge; a second connection to the origin follows the SSL/TLS mode.
- Why does HTML return DYNAMIC on a fresh zone? HTML is not cached by default and no rule opted it in.
- A Worker is routed on
/api/*but the hostname is grey-clouded. Does it run? No; routes require a proxied record. - An origin takes 200 seconds. What does the visitor see? A 524 at the 125-second read timeout; only Enterprise zones can raise it.
Unresolved limitations. No controlled origin was deployed, so no latency, hit ratio, or failure timing was measured. Paid behavior — the Managed Ruleset, Argo, cache-tag purge, longer timeouts — was not exercised. Cache state is data-center-specific, so a HIT in one colo does not guarantee one in another. Ranges, entitlements, and limits change, and the sample reflects Cloudflare's own site.
References (verified 2026-11-04):
- How Cloudflare works: https://developers.cloudflare.com/fundamentals/concepts/how-cloudflare-works/
- Proxy status: https://developers.cloudflare.com/dns/proxy-status/
- Default cache behavior: https://developers.cloudflare.com/cache/concepts/default-cache-behavior/
- Cache response statuses: https://developers.cloudflare.com/cache/concepts/cache-responses/
- Connection limits: https://developers.cloudflare.com/fundamentals/reference/connection-limits/
- Error 524: https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-524/
- SSL/TLS modes: https://developers.cloudflare.com/ssl/origin-configuration/ssl-modes/
- HTTP headers: https://developers.cloudflare.com/fundamentals/reference/http-headers/
- Workers limits: https://developers.cloudflare.com/workers/platform/limits/
- Workers pricing: https://developers.cloudflare.com/workers/platform/pricing/
- Worker routes: https://developers.cloudflare.com/workers/configuration/routing/routes/
- Cache Rules: https://developers.cloudflare.com/cache/how-to/cache-rules/
- Managed Rules: https://developers.cloudflare.com/waf/managed-rules/
- Cloudflare Tunnel: https://developers.cloudflare.com/tunnel/get-started/
Next in the Series
In Accounts, Zones, Permissions, and Product Plans, we'll explore Understand resource ownership before configuring services.