Domain IP Lookup

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

Security

How Origin IP Discovery Works Behind Cloudflare: Auditing Your Edge Security

4 min readBy Domain IP Lookup Team

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

Cloudflare's Anycast proxy layer sits between visitors and the origin server. If an attacker discovers the origin IP, they can connect directly and bypass edge security.

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 LabelService PurposeCloudflare Proxy StatusExposure Severity
mail.example.comSMTP / IMAP Mail ExchangerDNS-Only (Grey Cloud)Critical: Leaks origin IP if web and mail share one VPS
direct.example.comSSH / Administrative AccessDNS-Only (Grey Cloud)Critical: Directly publishes the unproxied server IP
cpanel.example.com / whmWeb Hosting Control PanelDNS-Only (Grey Cloud)High: Points to origin hosting infrastructure
ftp.example.com / sftpFile Transfer ProtocolDNS-Only (Grey Cloud)High: Points directly to server interface
autodiscover.example.comMail Client ConfigurationDNS-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.

Testing Direct TLS SNI Handshake against an Origin IP
$ 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 GMT

If 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. 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. 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. 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. 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.

Example Linux iptables Script Permitting Only Cloudflare Inbound Traffic
#!/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 DROP

Key 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.

Cloudflarereverse proxyorigin securitySSRFDNS audit

Frequently asked questions