How does Cloudflare work?

  • Published
  • Updated
  • Reading time 3 min
How does Cloudflare work?

Cloudflare's global network can help improve the security, performance, reliability and privacy of internet-connected systems, including websites, SaaS applications and business networks.

Application services

For websites and web applications, Cloudflare can act both as a DNS provider and as a reverse proxy for web traffic.

How Cloudflare works as a DNS provider

Cloudflare supports several DNS configurations. A common option is a full setup, where it becomes the domain's primary authoritative DNS provider. Once your domain is connected, Cloudflare answers DNS queries on its behalf. You can manage DNS records through the dashboard or API.

The answer to a DNS query depends on the record's configuration, including its value, eligibility for proxying and proxy status.

  • If the domain is active and an eligible record is set to Proxied, Cloudflare returns its anycast IP addresses rather than exposing the configured origin address in that response. HTTP/HTTPS requests then reach Cloudflare's network first.
  • If the record is set to DNS only, the response resolves to the configured destination rather than using Cloudflare's HTTP proxy. Web traffic goes directly to that destination, without the protections provided by Cloudflare's reverse proxy.

How Cloudflare works as a reverse proxy

Eligible A, AAAA and CNAME records can be proxied or DNS-only. For an active domain, HTTP/HTTPS traffic associated with a proxied record passes through Cloudflare.

Cloudflare processes those requests according to your configuration. Depending on cache status and security rules, it may serve a response from its network or forward an allowed request to the origin.

Additional information:

  • Cloudflare Load Balancing can help direct traffic between your servers or other endpoints.
  • A CDN can cache and deliver eligible content closer to visitors, reducing work at the origin and improving delivery performance.

Note:

Proxy status applies to eligible A, AAAA and CNAME records. For HTTP/HTTPS on non-standard ports or other TCP/UDP applications, check the supported ports and whether an appropriate Cloudflare Spectrum plan is required.

To see which records are proxied, sign in to the Cloudflare dashboard, select your domain and open the DNS records page.

Example DNS records

Type Name Contents Proxy status TTL Actions
A blog 192.0.2.1 Proxied Auto Edit
A shop 192.0.2.2 DNS only Auto Edit

Example of a proxied DNS record

When a browser sends an HTTP/HTTPS request to blog.example.com, a DNS resolver first resolves the hostname. With Cloudflare providing authoritative DNS and the record proxied, the response supplies Cloudflare anycast IP addresses. The browser connects to Cloudflare, which handles the request and contacts the origin where needed: 192.0.2.1.

Example of a DNS-only record

When a browser sends an HTTP/HTTPS request to shop.example.com, a DNS resolver resolves the hostname. Although Cloudflare provides authoritative DNS, the record is not proxied, so its response resolves to 192.0.2.2. The browser then sends the HTTP/HTTPS request directly to the server at 192.0.2.2.

HTTP methods supported by Cloudflare

Cloudflare supports standard HTTP methods, with restrictions on CONNECT, TRACE and PURGE.

If you would prefer not to manage DNS, caching and security rules yourself, SeoRocket provides Cloudflare website management , from initial configuration to ongoing monitoring and adjustments.

Cloudflare's wider features can support further network performance and security work, depending on your requirements and plan.

Sources and further reading

About the author

Mantas Jankauskas
Mantas Jankauskas SeoRocket.lt

Specialises in technical web solutions, website performance and implementing SEO requirements. His work includes technical SEO, migrations, structural changes and other tasks that affect indexing, website stability and user experience.

More articles by this author
Next article Building an online shop: what should you know? Building an online shop: what should you know? Read