Why a lookup shows the CDN, not the origin
Visitor
looks up the domain
CDN edge
104.21.x.x
this is what DNS returns
Origin server
real IP, never exposed
How Origin IP Discovery Works Behind Cloudflare: Auditing Your Edge Security
When a domain activates Cloudflare's reverse proxy (the 'orange cloud' in the Cloudflare DNS dashboard), public DNS queries for its A and AAAA records no longer return the IP address of the physical web server. Instead, DNS resolvers receive Cloudflare Anycast IP addresses assigned to over 300 edge datacenters worldwide. Inbound HTTP and HTTPS traffic from visitors terminates at the nearest edge Point of Presence (PoP), where Cloudflare inspects requests for Web Application Firewall (WAF) violations, DDoS attack signatures, and bot behavior before forwarding clean requests to the backend origin.
Why a lookup shows the CDN, not the origin
Visitor
looks up the domain
CDN edge
104.21.x.x
this is what DNS returns
Origin server
real IP, never exposed
The Threat Model of Origin IP Exposure
Cloudflare's edge security controls operate as an inbound gateway. However, if an adversary uncovers the origin server's direct public IPv4 or IPv6 address, they can construct HTTP requests targeting the origin IP directly while preserving the original Host: header (e.g., curl -H 'Host: target.com' http://203.0.113.50/).
Bypassing the edge proxy exposes the origin to unmitigated Layer 7 DDoS volumetric floods, automated credential stuffing, vulnerability scanning that would otherwise be blocked by managed WAF rules, and direct exploitation of backend services. Origin auditing is therefore a foundational requirement for production cloud security.
Vector 1: Unproxied Subdomains and Grey-Cloud DNS Records
The most frequent origin leak stems from DNS records configured with Cloudflare's proxy disabled ('grey-cloud' or DNS-only mode). Cloudflare's standard reverse proxy supports HTTP and HTTPS on standard web ports (80, 443, 8080, 8443, etc.). Non-HTTP protocols such as SMTP, IMAP, SSH, FTP, or custom game servers cannot pass through the standard HTTP proxy unless using Cloudflare Spectrum.
Sysadmins frequently create subdomains to access these administrative services on the same host:
| Subdomain Label | Service Purpose | Cloudflare Proxy Status | Exposure Severity |
|---|---|---|---|
| mail.example.com | SMTP / IMAP Mail Exchanger | DNS-Only (Grey Cloud) | Critical: Leaks origin IP if web and mail share one VPS |
| direct.example.com | SSH / Administrative Access | DNS-Only (Grey Cloud) | Critical: Directly publishes the unproxied server IP |
| cpanel.example.com / whm | Web Hosting Control Panel | DNS-Only (Grey Cloud) | High: Points to origin hosting infrastructure |
| ftp.example.com / sftp | File Transfer Protocol | DNS-Only (Grey Cloud) | High: Points directly to server interface |
| autodiscover.example.com | Mail Client Configuration | DNS-Only (Grey Cloud) | Moderate: Often aliases unproxied mail servers |
Vector 2: Historical DNS Telemetry and Archives
DNS records are broadcast globally and continuously archived by security telemetry services like SecurityTrails, DNSDB, Censys, and VirusTotal. If a domain was hosted on a VPS for months or years with a standard A record pointing directly to 203.0.113.50 before migrating to Cloudflare, that IP address remains permanently recorded in historical datasets.
If the site owner simply activates the Cloudflare orange-cloud proxy without reprovisioning their server with a new IP address, querying historical DNS records reveals the active origin server immediately. When onboarding a production application to Cloudflare, always rotate the public IP address at your hosting provider or cloud vendor.
Vector 3: SSL/TLS Certificate Fingerprinting and Censys Scans
When an origin server hosts an SSL/TLS certificate configured for its primary domain name (e.g., a Let's Encrypt or Sectigo certificate), internet-wide scanning engines (Censys, Shodan) scan the entire IPv4 space on port 443 daily. If the origin web server accepts connections on its public IP and presents the domain's TLS certificate during the Server Name Indication (SNI) handshake, security scanners index the IP alongside the domain name in searchable public databases.
$ openssl s_client -connect 203.0.113.50:443 -servername example.com < /dev/null 2>/dev/null | openssl x509 -noout -subject -dates
subject=CN = example.com
notBefore=Oct 10 00:00:00 2026 GMT
notAfter=Jan 8 23:59:59 2027 GMTIf this query successfully returns the domain certificate, the origin is discoverable via automated TLS fingerprinting. To prevent this, configure the web server's default fallback virtual host on port 443 with a self-signed generic certificate or drop non-Cloudflare TLS handshakes entirely.
Vector 4: Outbound Server Connections and SSRF Leaks
Cloudflare reverse proxies govern inbound connections. Outbound traffic initiated by the web application itself exits directly through the origin server's default network gateway, bypassing Cloudflare entirely. Attackers exploit outbound features to capture the origin IP:
- Transactional Email Headers: If an application generates password reset or registration emails using a local Sendmail or Postfix daemon rather than an external API (SendGrid, Postmark), the
Received:header inside the recipient's inbox contains the server's public IP address. - Webhooks and URL Pingbacks: Features that allow users to register webhook endpoints can be targeted by registering a webhook pointing to a listener server under the tester's control.
- Server-Side Request Forgery (SSRF): Vulnerabilities allowing users to supply URLs for avatar uploads, PDF rendering, or link previews cause the backend origin to fetch the remote resource directly, logging its IP on the remote server.
The Complete Origin Hardening Blueprint
1. Lock Down Origin Firewalls to Cloudflare IP Ranges
Configure your server's packet filter (UFW, iptables, AWS Security Groups) to drop all incoming TCP traffic on ports 80 and 443 unless the source IP belongs to Cloudflare's published IP blocks (https://www.cloudflare.com/ips/).
2. Deploy Cloudflare Authenticated Origin Pulls (mTLS)
Enforce mutual TLS between Cloudflare's edge servers and your origin. The origin web server validates that every incoming HTTPS connection presents a trusted Cloudflare client certificate, rejecting direct connections even if the IP is known.
3. Adopt Cloudflare Tunnels (Zero Inbound Ports)
Install 'cloudflared' on your origin host. The tunnel agent establishes outbound-only connections over QUIC or HTTP/2 to Cloudflare edge PoPs. You can close all inbound public ports (80, 443, 22) entirely on your cloud firewall.
4. Rotate Origin Public IP Address
After implementing firewall rules or Cloudflare Tunnels, allocate a new Elastic IP or provision a new server instance. This permanently invalidates all historical DNS records and scanning archives.
#!/usr/bin/env bash
# Flush existing rules on port 80 and 443
iptables -N CLOUDFLARE
iptables -A INPUT -p tcp -m multiport --dports 80,443 -j CLOUDFLARE
# Allow Cloudflare official IPv4 ranges
for ip in $(curl -s https://www.cloudflare.com/ips-v4); do
iptables -A CLOUDFLARE -s $ip -j ACCEPT
done
# Drop all remaining direct traffic on web ports
iptables -A CLOUDFLARE -j DROPKey takeaway
Enabling Cloudflare's proxy hides DNS records, but origin security requires defense-in-depth: closing unproxied subdomains, configuring server firewalls to accept traffic solely from Cloudflare IPs or utilizing outbound-only Cloudflare Tunnels, and rotating the origin IP.
Check your result and continue troubleshooting
Use the dns lookup tool to inspect the public DNS data relevant to this guide. Record the hostname, query type, resolver and time so you can compare results after a change. This is a DNS check, not a guarantee of worldwide propagation or successful application delivery.
For the underlying behavior and current configuration guidance, consult the official reference. Provider dashboards can change; use the values shown for your own domain rather than copying an example into production.
Need to check a domain's public DNS addresses? Use the Domain IP Lookup tool.
Frequently asked questions
Related reading
Why a lookup shows the CDN, not the origin
Visitor
looks up the domain
CDN edge
104.21.x.x
this is what DNS returns
Origin server
real IP, never exposed
Why a CDN Shows Its IP Instead of the Origin Server IP
Looked up a domain and got a Cloudflare address? That is the system working correctly. Here is what sits behind it and why you cannot see through.
The same address, four different ways to write it
SSRF and DNS: How Server-Side Request Forgery Exploits Domain Resolution
Master the intersection of SSRF (CWE-918) and DNS. Learn alternate IP encodings, 0.0.0.0 loopbacks, CNAME redirection traps, and hardened network architectures.
SSRF turns a server into an unwilling proxy
Attacker
crafts a request URL
Vulnerable server
fetches it, SSRF-tricked
169.254.169.254
the metadata endpoint
Credentials
returned to the attacker
Cloud Metadata Endpoint Risks: IMDSv1 vs. IMDSv2 and DNS Exfiltration Vectors
Understand the risks of the 169.254.169.254 cloud metadata endpoint. Compare AWS IMDSv1 vs IMDSv2, GCP and Azure metadata formats, and network-level defenses.