
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Fri, 10 Apr 2026 03:36:45 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Connect and secure any private or public app by hostname, not IP — free for everyone in Cloudflare One]]></title>
            <link>https://blog.cloudflare.com/tunnel-hostname-routing/</link>
            <pubDate>Thu, 18 Sep 2025 14:00:00 GMT</pubDate>
            <description><![CDATA[ Tired of IP Lists? Securely connect private networks to any app by its hostname, not its IP address. This routing is now built into Cloudflare Tunnel and is free for all Cloudflare One customers. ]]></description>
            <content:encoded><![CDATA[ <p>Connecting to an application should be as simple as knowing its name. Yet, many security models still force us to rely on brittle, ever-changing IP addresses. And we heard from many of you that managing those ever-changing IP lists was a constant struggle. </p><p>Today, we’re taking a major step toward making that a relic of the past.</p><p>We're excited to announce that you can now route traffic to <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/"><u>Cloudflare Tunnel</u></a> based on a hostname or a domain. This allows you to use Cloudflare Tunnel to build simple zero-trust and egress policies for your private and public web applications without ever needing to know their underlying IP. This is one more step on our <a href="https://blog.cloudflare.com/egress-policies-by-hostname/"><u>mission</u></a> to strengthen platform-wide support for hostname- and domain-based policies in the <a href="https://developers.cloudflare.com/cloudflare-one/"><u>Cloudflare One</u></a> <a href="https://www.cloudflare.com/learning/access-management/what-is-sase/">SASE</a> platform, simplifying complexity and improving security for our customers and end users. </p>
    <div>
      <h2>Grant access to applications, not networks</h2>
      <a href="#grant-access-to-applications-not-networks">
        
      </a>
    </div>
    <p>In August 2020, the National Institute of Standards (NIST) published <a href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-207.pdf"><u>Special Publication 800-207</u></a>, encouraging organizations to abandon the "castle-and-moat" model of security (where trust is established on the basis of network location) and move to a <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust model </a>(where we “<a href="https://www.whitehouse.gov/wp-content/uploads/2022/01/M-22-09.pdf"><u>verify anything and everything attempting to establish access</u></a>").</p><p>Now, instead of granting broad network permissions, you grant specific access to individual resources. This concept, known as per-resource authorization, is a cornerstone of the Zero Trust framework, and it presents a huge change to how organizations have traditionally run networks. Per-resource authorization requires that access policies be configured on a per-resource basis. By applying the principle of least privilege, you give users access only to the resources they absolutely need to do their job. This tightens security and shrinks the potential attack surface for any given resource.</p><p>Instead of allowing your users to access an entire network segment, like <code><b>10.131.0.0/24</b></code>, your security policies become much more precise. For example:</p><ul><li><p>Only employees in the "SRE" group running a managed device can access <code><b>admin.core-router3-sjc.acme.local</b></code>.</p></li><li><p>Only employees in the "finance" group located in Canada can access <code><b>canada-payroll-server.acme.local</b></code>.</p></li><li><p>All employees located in New York can access<b> </b><code><b>printer1.nyc.acme.local</b></code>.</p></li></ul><p>Notice what these powerful, granular rules have in common? They’re all based on the resource’s private <b>hostname</b>, not its IP address. That’s exactly what our new hostname routing enables. We’ve made it dramatically easier to write effective zero trust policies using stable hostnames, without ever needing to know the underlying IP address.</p>
    <div>
      <h2>Why IP-based rules break</h2>
      <a href="#why-ip-based-rules-break">
        
      </a>
    </div>
    <p>Let's imagine you need to secure an internal server, <code><b>canada-payroll-server.acme.local</b></code>. It’s hosted on internal IP <code><b>10.4.4.4</b></code> and its hostname is available in internal private DNS, but not in public DNS. In a modern cloud environment, its IP address is often the least stable thing about it. If your security policy is tied to that IP, it's built on a shaky foundation.</p><p>This happens for a few common reasons:</p><ul><li><p><b>Cloud instances</b>: When you launch a compute instance in a cloud environment like AWS, you're responsible for its <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hostname-types.html"><u>hostname</u></a>, but not always its IP address. As a result, you might only be tracking the hostname and may not even know the server's IP.</p></li><li><p><b>Load Balancers</b>: If the server is behind a load balancer in a cloud environment (like AWS ELB), its IP address could be changing dynamically in response to <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html"><u>changes in traffic</u></a>.</p></li><li><p><b>Ephemeral infrastructure</b>: This is the "<a href="https://cloudscaling.com/blog/cloud-computing/the-history-of-pets-vs-cattle/"><u>cattle, not pets</u></a>" world of modern infrastructure. Resources like servers in an autoscaling group, containers in a Kubernetes cluster, or applications that spin down overnight are created and destroyed as needed. They keep a persistent hostname so users can find them, but their IP is ephemeral and changes every time they spin up.</p></li></ul><p>To cope with this, we've seen customers build complex scripts to maintain dynamic "IP Lists" — mappings from a hostname to its IPs that are updated every time the address changes. While this approach is clever, maintaining IP Lists is a chore. They are brittle, and a single error could cause employees to lose access to vital resources.</p><p>Fortunately, hostname-based routing makes this IP List workaround obsolete.</p>
    <div>
      <h2>How it works: secure a private server by hostname using Cloudflare One SASE platform</h2>
      <a href="#how-it-works-secure-a-private-server-by-hostname-using-cloudflare-one-sase-platform">
        
      </a>
    </div>
    <p>To see this in action, let's create a policy from our earlier example: we want to grant employees in the "finance" group located in Canada access to <code><b>canada-payroll-server.acme.local</b></code>. Here’s how you do it, without ever touching an IP address.</p><p><b>Step 1: Connect your private network</b></p><p>First, the server's network needs a secure connection to Cloudflare's global network. You do this by installing our lightweight agent, <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/"><u>cloudflared</u></a>, in the same local area network as the server, which creates a secure Cloudflare Tunnel. You can create a new tunnel directly from cloudflared by running <code><b>cloudflared tunnel create &lt;TUNNEL-NAME&gt;</b></code> or using your Zero Trust dashboard.</p><div>
  
</div><p>
<b>Step 2: Route the hostname to the tunnel</b></p><p>This is where the new capability comes into play. In your Zero Trust dashboard, you now establish a route that binds the <i>hostname</i> <code>canada-payroll-server.acme.local</code> directly to that tunnel. In the past, you could only route an IP address (<code>10.4.4.4)</code> or its subnet (<code>10.4.4.0/24</code>). That old method required you to create and manage those brittle IP Lists we talked about. Now, you can even route entire domains, like <code>*.acme.local</code>, directly to the tunnel, simply by creating a hostname route to <code>acme.local</code>.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3mcoBAILYENIP6kGW4tw96/bb7ec6571ae7b4f04b5dc0456f694d59/1.png" />
          </figure><p>For this to work, you must delete your private network’s subnet (in this case <code>10.0.0.0/8</code>) and <code>100.64.0.0/10</code> from the <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/configure-warp/route-traffic/split-tunnels/"><u>Split Tunnels Exclude</u></a> list. You also need to remove <code>.local</code> from the <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/configure-warp/route-traffic/local-domains/"><u>Local Domain Fallback</u></a>.</p><p>(As an aside, we note that this feature also works with domains. For example, you could bind <code>*.acme.local</code> to a single tunnel, if desired.)</p><p><b>Step 3: Write your zero trust policy</b></p><p>Now that Cloudflare knows <i>how</i> to reach your server by its name, you can write a policy to control <i>who</i> can access it. You have a couple of options:</p><ul><li><p><b>In Cloudflare Access (for HTTPS applications):</b> Write an <a href="https://developers.cloudflare.com/cloudflare-one/applications/non-http/self-hosted-private-app/"><u>Access policy</u></a> that grants employees in the “finance” group access to the private hostname <code>canada-payroll-server.acme.local</code>. This is ideal for applications accessible over HTTPS on port 443.
</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7lIZI9ThsAWtxFZZis3HtZ/08451586dbe373ff137bd9e91d23dea6/2.png" />
          </figure><p></p></li><li><p><b>In Cloudflare Gateway (for HTTPS applications):</b> Alternatively, write a <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/"><u>Gateway policy</u></a> that grants employees in the “finance” group access to the <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/network-policies/#sni"><u>SNI</u></a> <code>canada-payroll-server.acme.local</code>. This <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/network-policies/protocol-detection/"><u>works</u></a> for services accessible over HTTPS on any port.
</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5GpwDZNmdzapOyjOgFFlKD/50e2d0df64d2230479ad8d0a013de24b/3.png" />
          </figure><p></p></li><li><p><b>In Cloudflare Gateway (for non-HTTP applications):</b> You can also write a <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/"><u>Gateway policy</u></a> that blocks DNS resolution <code>canada-payroll-server.acme.local</code> for all employees except the “finance” group.</p></li></ul>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3na5Mf6UMpBcKYm6JWmnzd/5791054c944300e667c3829e9bd8c6ec/4.png" />
          </figure><p>The principle of "trust nothing" means your security posture should start by denying traffic by default. For this setup to work in a true Zero Trust model, it should be paired with a default Gateway policy that blocks all access to your internal IP ranges. Think of this as ensuring all doors to your private network are locked by default. The specific <code>allow</code> policies you create for hostnames then act as the keycard, unlocking one specific door only for authorized users.</p><p>Without that foundational "deny" policy, creating a route to a private resource would make it accessible to everyone in your organization, defeating the purpose of a least-privilege model and creating significant security risks. This step ensures that only the traffic you explicitly permit can ever reach your corporate resources.</p><p>And there you have it. We’ve walked through the entire process of writing a per-resource policy using only the server’s private hostname. No IP Lists to be seen anywhere, simplifying life for your administrators.</p>
    <div>
      <h2>Secure egress traffic to third-party applications</h2>
      <a href="#secure-egress-traffic-to-third-party-applications">
        
      </a>
    </div>
    <p>Here's another powerful use case for hostname routing: controlling outbound connections from your users to the public Internet. Some third-party services, such as banking portals or partner APIs, use an IP allowlist for security. They will only accept connections that originate from a specific, dedicated public source IP address that belongs to your company.</p><p>This common practice creates a challenge. Let's say your banking portal at <code>bank.example.com</code> requires all traffic to come from a dedicated source IP <code>203.0.113.9</code> owned by your company. At the same time, you want to enforce a zero trust policy that <i>only</i> allows your finance team to access that portal. You can't build your policy based on the bank's destination IP — you don't control it, and it could change at any moment. You have to use its hostname.</p><p>There are two ways to solve this problem. First, if your dedicated source IP is purchased from Cloudflare, you can use the <a href="https://blog.cloudflare.com/egress-policies-by-hostname/"><u>“egress policy by hostname” feature</u></a> that we announced previously. By contrast, if your dedicated source IP belongs to your organization, or is leased from cloud provider, then we can solve this problem with hostname-based routing, as shown in the figure below:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6wXu6FMiiVz4lXsESFrBTg/e1bb13e8eef0653ab311d0800d95f391/5.png" />
          </figure><p>Here’s how this works:</p><ol><li><p><b>Force traffic through your dedicated IP.</b> First, you deploy a <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/"><u>Cloudflare Tunnel</u></a> in the network that owns your dedicated IP (for example, your primary VPC in a cloud provider). All traffic you send through this tunnel will exit to the Internet with <code>203.0.113.9</code> as its source IP.</p></li><li><p><b>Route the banking app to that tunnel.</b> Next, you create a hostname route in your Zero Trust dashboard. This rule tells Cloudflare: "Any traffic destined for <code>bank.example.com</code> must be sent through this specific tunnel."</p></li><li><p><b>Apply your user policies.</b> Finally, in Cloudflare Gateway, you create your granular access rules. A low-priority <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/network-policies/"><u>network policy</u></a> blocks access to the <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/network-policies/#sni"><u>SNI</u></a> <code>bank.example.com</code> for everyone. Then, a second, higher-priority policy explicitly allows users in the "finance" group to access the <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/network-policies/#sni"><u>SNI</u></a> <code>bank.example.com</code>.</p></li></ol><p>Now, when a finance team member accesses the portal, their traffic is correctly routed through the tunnel and arrives with the source IP the bank expects. An employee from any other department is blocked by Gateway before their traffic even enters the tunnel. You've enforced a precise, user-based zero trust policy for a third-party service, all by using its public hostname.</p>
    <div>
      <h2>Under the hood: how hostname routing works</h2>
      <a href="#under-the-hood-how-hostname-routing-works">
        
      </a>
    </div>
    <p>To build this feature, we needed to solve a classic networking challenge. The routing mechanism for Cloudflare Tunnel is a core part of Cloudflare Gateway, which operates at both Layer 4 (TCP/UDP) and Layer 7 (HTTP/S) of the network stack.</p><p>Cloudflare Gateway must make a decision about which Cloudflare Tunnel to send traffic upon receipt of the very first IP packet in the connection. This means the decision must necessarily be made at Layer 4, where Gateway only sees the IP and TCP/UDP headers of a packet. IP and TCP/UDP headers contain the destination IP address, but do not contain destination <i>hostname</i>. The hostname is only found in Layer 7 data (like a TLS SNI field or an HTTP Host header), which isn't even available until after the Layer 4 connection is already established.</p><p>This creates a dilemma: how can we route traffic based on a hostname before we've even seen the hostname? </p>
    <div>
      <h3>Synthetic IPs to the rescue</h3>
      <a href="#synthetic-ips-to-the-rescue">
        
      </a>
    </div>
    <p>The solution lies in the fact that Cloudflare Gateway also acts as a DNS resolver. This means we see the user's <i>intent </i>— the DNS query for a hostname — <i>before</i> we see the actual application traffic. We use this foresight to "tag" the traffic using a <a href="https://blog.cloudflare.com/egress-policies-by-hostname/"><u>synthetic IP address</u></a>.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7Kd3x5SppGp8G4KZeO34n/67b338ca8e81db63e110dc89c7596bf6/6.png" />
          </figure><p>Let’s walk through the flow:</p><ol><li><p><b>DNS Query</b>. A user's device sends a DNS query for
 <code>canada-payroll-server.acme.local </code>to the Gateway resolver.</p></li><li><p><b>Private Resolution</b>. Gateway asks the <code>cloudflared </code>agent running in your private network to resolve the real IP for that hostname. Since <code>cloudflared</code> has access to your internal DNS, it finds the real private IP <code>10.4.4.4</code>, and sends it back to the Gateway resolver.</p></li><li><p><b>Synthetic Response</b>. Here's the key step. Gateway resolver <b>does not</b> send the real IP (<code>10.4.4.4</code>) back to the user. Instead, it temporarily assigns an <i>initial resolved IP</i> from a reserved Carrier-Grade NAT (CGNAT) address space (e.g., <code>100.80.10.10</code>) and sends the initial resolved IP back to the user's device. The initial resolved IP acts as a tag that allows Gateway to identify network traffic destined to <code>canada-payroll-server.acme.local</code>. The initial resolved IP is randomly selected and temporarily assigned from one of the two IP address ranges:</p><ul><li><p>IPv4: <code>100.80.0.0/16</code></p></li><li><p>IPv6: <code>2606:4700:0cf1:4000::/64</code> </p></li></ul></li><li><p><b>Traffic Arrives</b>. The user's device sends its application traffic (e.g., an HTTPS request) to the destination IP it received from Gateway resolver: the initial resolved IP <code>100.80.10.10</code>.</p></li><li><p><b>Routing and Rewriting</b>. When Gateway sees an incoming packet destined for <code>100.80.10.10</code>, it knows this traffic is for <code>canada-payroll-server.acme.local</code> and must be sent through a specific Cloudflare Tunnel. It then rewrites the destination IP on the packet back to the <i>real</i> private destination IP (<code>10.4.4.4</code>) and sends it down the correct tunnel.</p></li></ol><p>The traffic goes down the tunnel and arrives at <code>canada-payroll-server.acme.local</code> at IP (<code>10.4.4.4)</code> and the user is connected to the server without noticing any of these mechanisms. By intercepting the DNS query, we effectively tag the network traffic stream, allowing our Layer 4 router to make the right decision without needing to see Layer 7 data.</p>
    <div>
      <h2>Using Gateway Resolver Policies for fine grained control</h2>
      <a href="#using-gateway-resolver-policies-for-fine-grained-control">
        
      </a>
    </div>
    <p>The routing capabilities we've discussed provide simple, powerful ways to connect to private resources. But what happens when your network architecture is more complex? For example, what if your private DNS servers are in one part of your network, but the application itself is in another?</p><p>With Cloudflare One, you can solve this by creating policies that separate the path for DNS resolution from the path for application traffic for the very same hostname using <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/resolver-policies"><u>Gateway Resolver Policies</u></a>. This gives you fine-grained control to match complex network topologies.</p><p>Let's walk through a scenario:</p><ul><li><p>Your private DNS resolvers, which can resolve <code><b>acme.local</b></code>, are located in your core datacenter, accessible only via <code><b>tunnel-1</b></code>.</p></li><li><p>The webserver for <code><b>canada-payroll-server.acme.local</b></code><b> </b>is hosted in a specific cloud VPC, accessible only via <code><b>tunnel-2</b></code>.</p></li></ul>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2sVMsS4DhuN2yoTlGWTK5X/e5a66330c951e7b65428f5c76b5c7b0a/7.png" />
          </figure><p>Here’s how to configure this split-path routing.</p><p><b>Step 1: Route DNS Queries via </b><code><b>tunnel-1</b></code></p><p>First, we need to tell Cloudflare Gateway how to reach your private DNS server</p><ol><li><p><b>Create an IP Route:</b> In the Networks &gt; Tunnels area of your Zero Trust dashboard, create a route for the IP address of your private DNS server (e.g., <code><b>10.131.0.5/32</b></code>) and point it to <code><b>tunnel-1</b></code><code>.</code> This ensures any traffic destined for that specific IP goes through the correct tunnel to your datacenter.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/32JcjFZXGuhDEHHlWJoF1C/4223a6f2e5b7b49015abfbfd9b4fd20f/8.png" />
          </figure><p></p></li><li><p><b>Create a Resolver Policy:</b> Go to <b>Gateway -&gt; Resolver Policies</b> and create a new policy with the following logic:</p><ul><li><p><b>If</b> the query is for the domain <code><b>acme.local</b></code> …</p></li><li><p><b>Then</b>... resolve it using a designated DNS server with the IP <code><b>10.131.0.5</b></code>.
</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2j8kYsD692tCRYcDKoDXvb/7dbb20f426ba47350fb0b2906046d5f0/9.png" />
          </figure><p></p></li></ul></li></ol><p>With these two rules, any DNS lookup for <code><b>acme.local</b></code> from a user's device will be sent through <code>tunnel-1</code> to your private DNS server for resolution.</p><p><b>Step 2: Route Application Traffic via </b><code><b>tunnel-2</b></code></p><p>Next, we'll tell Gateway where to send the actual traffic (for example, HTTP/S) for the application.</p><p><b>Create a Hostname Route:</b> In your Zero Trust dashboard, create a <b>hostname route</b> that binds <code><b>canada-payroll-server.acme.local </b></code>to <code><b>tunnel-2</b></code>.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3Ufzpsb1FUYrM39gMiyovs/c5d10828f58b0e7c854ff9fa721e1757/10.png" />
          </figure><p>This rule instructs Gateway that any application traffic (like HTTP, SSH, or any TCP/UDP traffic) for <code><b>canada-payroll-server.acme.local</b></code> must be sent through <code><b>tunnel-2</b></code><b> </b>leading to your cloud VPC.</p><p>Similarly to a setup without Gateway Resolver Policy, for this to work, you must delete your private network’s subnet (in this case <code>10.0.0.0/8</code>) and <code>100.64.0.0/10</code> from the <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/configure-warp/route-traffic/split-tunnels/"><u>Split Tunnels Exclude</u></a> list. You also need to remove <code>.local</code> from the <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/configure-warp/route-traffic/local-domains/"><u>Local Domain Fallback</u></a>.</p><p><b>Putting It All Together</b></p><p>With these two sets of policies, the "synthetic IP" mechanism handles the complex flow:</p><ol><li><p>A user tries to access <code>canada-payroll-server.acme.local</code>. Their device sends a DNS query to Cloudflare Gateway Resolver.</p></li><li><p>This DNS query matches a Gateway Resolver Policy, causing Gateway Resolver to forward the DNS query through <code>tunnel-1</code> to your private DNS server (<code>10.131.0.5</code>).</p></li><li><p>Your DNS server responds with the server’s actual private destination IP (<code>10.4.4.4</code>).</p></li><li><p>Gateway receives this IP and generates a “synthetic” initial resolved IP (<code>100.80.10.10</code>) which it sends back to the user's device.</p></li><li><p>The user's device now sends the HTTP/S request to the initial resolved IP (<code>100.80.10.10</code>).</p></li><li><p>Gateway sees the network traffic destined for the initial resolved IP (<code>100.80.10.10</code>) and, using the mapping, knows it's for <code>canada-payroll-server.acme.local</code>.</p></li><li><p>The Hostname Route now matches. Gateway sends the application traffic through tunnel-2 and rewrites its destination IP to the webserver’s actual private IP (<code>10.4.4.4</code>).</p></li><li><p>The <code>cloudflared</code> agent at the end of tunnel-2 forwards the traffic to the application's destination IP (<code>10.4.4.4</code>), which is on the same local network.</p></li></ol><p>The user is connected, without noticing that DNS and application traffic have been routed over totally separate private network paths. This approach allows you to support sophisticated split-horizon DNS environments and other advanced network architectures with simple, declarative policies.</p>
    <div>
      <h2>What onramps does this support?</h2>
      <a href="#what-onramps-does-this-support">
        
      </a>
    </div>
    <p>Our hostname routing capability is built on the "synthetic IP" (also known as <i>initially resolved IP</i>) mechanism detailed earlier, which requires specific Cloudflare One products to correctly handle both the DNS resolution and the subsequent application traffic. Here’s a breakdown of what’s currently supported for connecting your users (on-ramps) and your private applications (off-ramps).</p>
    <div>
      <h4><b>Connecting Your Users (On-Ramps)</b></h4>
      <a href="#connecting-your-users-on-ramps">
        
      </a>
    </div>
    <p>For end-users to connect to private hostnames, the feature currently works with <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/"><b><u>WARP Client</u></b></a>, agentless <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/agentless/pac-files/"><b><u>PAC files</u></b></a> and <a href="https://developers.cloudflare.com/cloudflare-one/policies/browser-isolation/"><b><u>Browser Isolation</u></b></a>.</p><p>Connectivity is also possible when users are behind <a href="https://developers.cloudflare.com/magic-wan/"><b><u>Magic WAN</u></b></a> (in active-passive mode) or <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/private-net/warp-connector/"><b><u>WARP Connector</u></b></a>, but it requires some additional configuration. To ensure traffic is routed correctly, you must update the routing table on your device or router to send traffic for the following destinations through Gateway:</p><ul><li><p>The initially resolved IP ranges: <code>100.80.0.0/16</code> (IPv4) and <code>2606:4700:0cf1:4000::/64</code> (IPv6).</p></li><li><p>The private network CIDR where your application is located (e.g., <code>10.0.0.0/8)</code>.</p></li><li><p>The IP address of your internal DNS resolver.</p></li><li><p>The Gateway DNS resolver IPs: <code>172.64.36.1</code> and <code>172.64.36.2</code>.</p></li></ul><p>Magic WAN customers will also need to point their DNS resolver to these Gateway resolver IPs and ensure they are running Magic WAN tunnels in active-passive mode: for hostname routing to work, DNS queries and the resulting network traffic must reach Cloudflare over the same Magic WAN tunnel. Currently, hostname routing will not work if your end users are at a site that has more than one Magic WAN tunnel actively transiting traffic at the same time.</p>
    <div>
      <h4><b>Connecting Your Private Network (Off-Ramps)</b></h4>
      <a href="#connecting-your-private-network-off-ramps">
        
      </a>
    </div>
    <p>On the other side of the connection, hostname-based routing is designed specifically for applications connected via <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/"><b><u>Cloudflare Tunnel</u></b></a> (<code>cloudflared</code>). This is currently the only supported off-ramp for routing by hostname.</p><p>Other traffic off-ramps, while fully supported for IP-based routing, are not yet compatible with this specific hostname-based feature. This includes using Magic WAN, WARP Connector, or WARP-to-WARP connections as the off-ramp to your private network. We are actively working to expand support for more on-ramps and off-ramps in the future, so stay tuned for more updates.</p>
    <div>
      <h2>Conclusion</h2>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>By enabling routing by hostname directly within Cloudflare Tunnel, we’re making security policies simpler, more resilient, and more aligned with how modern applications are built. You no longer need to track ever-changing IP addresses. You can now build precise, per-resource authorization policies for HTTPS applications based on the one thing that should matter: the name of the service you want to connect to. This is a fundamental step in making a zero trust architecture intuitive and achievable for everyone.</p><p>This powerful capability is available today, built directly into Cloudflare Tunnel and free for all Cloudflare One customers.</p><p>Ready to leave IP Lists behind for good? Get started by exploring our <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/private-net/cloudflared/connect-private-hostname/"><u>developer documentation</u></a> to configure your first hostname route. If you're new to <a href="https://developers.cloudflare.com/cloudflare-one/"><u>Cloudflare One</u></a>, you can sign up today and begin securing your applications and networks in minutes.</p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Tunnel]]></category>
            <category><![CDATA[SASE]]></category>
            <category><![CDATA[Cloudflare One]]></category>
            <category><![CDATA[Cloudflare Network]]></category>
            <category><![CDATA[Cloudflare Gateway]]></category>
            <category><![CDATA[Egress]]></category>
            <category><![CDATA[Zero Trust]]></category>
            <category><![CDATA[Access Control Lists (ACLs)]]></category>
            <category><![CDATA[Hostnames]]></category>
            <guid isPermaLink="false">gnroEH7P2oE00Ba0wJLHT</guid>
            <dc:creator>Nikita Cano</dc:creator>
            <dc:creator>Sharon Goldberg</dc:creator>
        </item>
        <item>
            <title><![CDATA[Introducing simple and secure egress policies by hostname in Cloudflare’s SASE platform]]></title>
            <link>https://blog.cloudflare.com/egress-policies-by-hostname/</link>
            <pubDate>Mon, 07 Jul 2025 13:00:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare's SASE platform now offers egress policies by hostname, domain, content category, and application in open beta. ]]></description>
            <content:encoded><![CDATA[ <p>Cloudflare’s <a href="https://www.cloudflare.com/learning/access-management/what-is-sase/"><u>SASE</u></a> platform is on a mission to strengthen our platform-wide support for hostname- and domain-based policies. This mission is being driven by enthusiastic demands from our customers, and boosted along the way by several interesting engineering challenges. Today, we’re taking a deep dive into the first milestone of this mission, which we recently released in open beta: <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/egress-policies/"><u>egress policies</u></a> by hostname, domain, <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/domain-categories/#content-categories"><u>content category</u></a>, and <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/application-app-types/"><u>application</u></a>. Let’s dive right in! </p>
    <div>
      <h2>Egress policies and IP ACLs</h2>
      <a href="#egress-policies-and-ip-acls">
        
      </a>
    </div>
    <p>Customers use our <a href="https://developers.cloudflare.com/learning-paths/secure-internet-traffic/build-egress-policies/"><u>egress policies</u></a> to control how their organization's Internet traffic connects to external services. An egress policy allows a customer to control the source IP address their traffic uses, as well as the geographic location that their traffic uses to egress onto the public Internet. Control of the source IP address is especially useful when accessing external services that apply policies to traffic based on source IPs, using IP Access Control Lists (ACLs). Some services use IP ACLs because they improve security, while others use them because they are explicitly required by regulation or compliance frameworks. </p><p>(That said, it's important to clarify that we do not recommend relying on IP ACLs as the only security mechanism used to gate access to a resource. Instead, IP ACLs should be used in combination with strong authentication like <a href="https://www.cloudflare.com/learning/access-management/what-is-sso/"><u>Single Sign On (SSO)</u></a>, <a href="https://www.cloudflare.com/learning/access-management/what-is-multi-factor-authentication/"><u>Multi Factor Authentication (MFA)</u></a>, <a href="https://fidoalliance.org/passkeys/"><u>passkeys</u></a>, etc.).</p><p>Let’s make the use case for egress policies more concrete with an example. </p><p>Imagine that Acme Co is a company that has purchased its own <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/egress-policies/dedicated-egress-ips/"><u>dedicated egress</u></a> IP address <code>203.0.113.9</code> from Cloudflare. Meanwhile, imagine a regulated banking application (<code>https://bank.example.com</code><u>)</u> that only grants access to the corporate account for Acme Co when traffic originates from source IP address <code>203.0.113.9</code>. Any traffic with a different source IP will be prevented from accessing Acme Co’s corporate account. In this way, the banking application uses IP ACLs to ensure that only employees from Acme Co can access Acme Co’s corporate account. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7KwZQRJksemP5QwXzT0S2P/2a45d3ac7581da31485a6d15c5ba6b03/image3.png" />
          </figure>
    <div>
      <h2>Egress policies by hostname</h2>
      <a href="#egress-policies-by-hostname">
        
      </a>
    </div>
    <p>Continuing our example, suppose that Acme Co wants to ensure that the banking application is off limits to all of its employees except those on its finance team. To accomplish this, Acme Co wants to write an egress policy that allows members of the finance team to egress from <code>203.0.113.9</code> when accessing <code>https://bank.example.com</code>, but employees outside of finance will not egress from <code>203.0.113.9</code> when attempting to access <code>https://bank.example.com</code>.  </p><p>As shown in the figure above, the combination of the banking application's IP ACLs and Acme Co’s egress policies ensures that <code>https://bank.example.com</code> is only accessible to its finance employees at Acme Co. </p><p>While this all sounds great, until now, this scenario was fairly difficult to achieve on <a href="https://www.cloudflare.com/zero-trust/products/"><u>Cloudflare’s SASE platform</u></a>. While we have long supported <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/egress-policies/"><u>egress policies</u></a> by user groups and other user attributes, we did not support writing egress policies by hostname. Instead, customers had to resort to writing egress policies by destination IP addresses.</p><p>To understand why customers have been clamoring for egress policies by hostname, let’s return to our example: </p><p>In our example, Acme Co wants to write a policy that allows only the finance team to access <code>https://bank.example.com</code>. In the past, in the absence of egress policies by hostname, Acme Co would need to write its egress policy in terms of the destination IP address of the banking application. </p><p>But how does Acme Co know the destination IP address of this banking application? The first problem is that the destination IP address belongs to an external service that is not controlled by Acme Co, and the second problem is that this IP address could change frequently, especially if the banking application uses <a href="https://en.wikipedia.org/wiki/Ephemeral_architecture"><u>ephemeral infrastructure</u></a> or sits behind a <a href="https://www.cloudflare.com/learning/cdn/glossary/reverse-proxy/"><u>reverse proxy</u></a> or <a href="https://www.cloudflare.com/learning/cdn/what-is-a-cdn/"><u>CDN</u></a>. Keeping up with changes to the destination IP address of an external service led some of our customers to write their own homegrown scripts that continuously update destination <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/lists/"><u>IP Lists</u></a> which are then fed to our egress policies using Cloudflare’s <a href="https://developers.cloudflare.com/api/resources/zero_trust/"><u>API</u></a>.</p><p>With this new feature, we do away with all these complications and simply allow our customers to write egress policies by hostname. </p>
    <div>
      <h2>Egress policies by domains, categories and applications too</h2>
      <a href="#egress-policies-by-domains-categories-and-applications-too">
        
      </a>
    </div>
    <p>Before we continue, we should note that this new feature also supports writing egress policies by:</p><ul><li><p>Domain: For example, we can now write an egress policy for <code>*.bank.example.com</code>, rather than an individual policy for each hostname (<code>bank.example.com</code>, <code>app.acmeco.bank.example.com</code>, <code>auth.bank.example.com</code>, etc.)</p></li><li><p>Category: For example, we can now write a single egress policy to control the egress IP address that employees use when accessing a site in the Cryptocurrency content category, rather than an individual policy for every Cryptocurrency website.</p></li><li><p>Application: For example, we can write a single egress policy for Slack, without needing to know all the different host and domain names (e.g. <code>app.slack.com</code>, <code>slack.com</code>, <code>acmeco.slack.com</code>, <code>slack-edge.com</code>) that Slack uses to serve its application.</p></li></ul><p>Here’s an example of writing an egress policy by application:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1so8jKsDbeWSfJAxh3yE9V/176e682aa1b0617fde4dd90732930460/image6.png" />
          </figure><p><sup><i>A view of the Cloudflare </i></sup><a href="https://dash.cloudflare.com/"><sup><i><u>dashboard</u></i></sup></a><sup><i> showing how to write an egress policy for a set of users and Applications. The policy is applied to users in the “finance” user group when accessing Applications including Microsoft Team, Slack, BambooHR and Progressive, and it determines the source IP that traffic uses when it egresses to the public Internet.</i></sup></p>
    <div>
      <h2>Why was this so hard to build?</h2>
      <a href="#why-was-this-so-hard-to-build">
        
      </a>
    </div>
    <p>Now let’s get into the engineering challenges behind this feature.</p><p>Egress polices are part of<a href="https://www.cloudflare.com/products/zero-trust/gateway/"> <u>Cloudflare Gateway</u></a>. Cloudflare Gateway is a<a href="https://www.cloudflare.com/learning/access-management/what-is-a-secure-web-gateway/"> <u>Secure Web Gateway (SWG)</u></a> that operates as both a <a href="https://www.cloudflare.com/learning/ddos/glossary/open-systems-interconnection-model-osi/"><u>layer 4 (L4)</u></a> and <a href="https://www.cloudflare.com/learning/ddos/glossary/open-systems-interconnection-model-osi/"><u>layer 7 (L7)</u></a> <a href="https://developers.cloudflare.com/learning-paths/replace-vpn/configure-device-agent/enable-proxy/"><u>proxy</u></a>. In other words, Cloudflare Gateway intercepts traffic by inspecting it at the transport layer (layer 4, including TCP and UDP), as well as at the application layer (layer 7, including HTTP).</p><p>The problem is that egress policies must necessarily be evaluated at layer 4, rather than at layer 7. Why? Because egress policies are used to select the source IP address for network traffic, and Cloudflare Gateway must select the source IP address for traffic <i>before</i> it creates the connection to the external service <code>bank.example.com</code>. If Gateway changes the source IP address in the middle of the connection, the connection will be broken. Therefore, Gateway must apply egress policies before it sends the very first packet in the connection. For instance, Gateway must apply egress policies before it sends the TCP SYN, which of course happens well before it sends any layer 7 information (e.g. HTTP). (See <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/order-of-enforcement/"><u>here</u></a> for more information on Gateway’s order of enforcement for its policies.)</p><p>The bottom line is that Gateway has no other information to use when applying the egress policy, other than the information in the IP header and the L4 (e.g. TCP) header of an IP packet. As you can see for the TCP/IPv4 packet below, a destination hostname is not part of the IP or TCP header in a packet. That's why we previously were not able to support egress policies by hostname, and instead required administrators to write egress policies by destination IP address.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5LS9YhSoRJzwBG18wt55Fa/e0a7251ef8a7fe15c9c3ccc42b0e7fb6/image4.png" />
          </figure>
    <div>
      <h2>So how did we build the feature?</h2>
      <a href="#so-how-did-we-build-the-feature">
        
      </a>
    </div>
    <p>We took advantage of the fact that <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/"><u>Cloudflare Gateway</u></a> also operates its own <a href="https://www.cloudflare.com/learning/access-management/what-is-dns-filtering/"><u>DNS resolver</u></a>. Every time an end user wants to access a destination hostname, the Gateway resolver first receives a DNS query for that hostname before sending its network traffic to the destination hostname. </p><p>To support egress policies by hostname, Gateway associates the DNS query for the hostname with the IP address  and TCP/UDP information in the network connection to the hostname. Specifically, Gateway will map the destination IP address in the end-user’s network connection to the hostname in the DNS query using a “synthetic IP” mechanism that is best explained using a diagram:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4cyJ0nD9cpXDqmo7FQJ0Ew/f9d93a8721645845c2036021dad57c27/image2.png" />
          </figure><p>Let’s walk through the flow:</p><p>1. When the end user makes a DNS query for <code>bank.example.com</code>, that DNS query is sent to the Gateway resolver.</p><p>2. The Gateway resolver does a public DNS lookup to associate bank.example.com to its destination IP address, which is <code>96.7.128.198</code>.</p><p>3. However, the Gateway resolver will not respond to the DNS query using the real destination IP <code>96.7.128.198</code>. Instead, it responds with an <i>initial resolved IP address</i> of <code>100.80.10.10</code>. This is not the real IP address for <code>bank.example.com</code>; instead, it acts as a tag that allows Gateway to identify network traffic destined to <code>bank.example.com</code>.  The initial resolved IP is randomly selected and temporarily assigned from one of the two IP address ranges below, which correspond to the Carrier Grade Network Address Translation (CGNAT) IP address spaces as defined in <a href="https://datatracker.ietf.org/doc/html/rfc6598"><u>RFC 6598</u></a> and <a href="https://datatracker.ietf.org/doc/rfc6264/"><u>RFC 6264</u></a>, respectively.</p><p>IPv4: 100.80.0.0/16</p><p>IPv6: 2606:4700:0cf1:4000::/64 </p><p>4. Gateway has now associated the initial resolved IP address <code>100.80.10.10</code>, with the hostname <code>bank.example.com</code>. Thus, when Gateway now sees network traffic to destination IP address <code>100.80.10.10</code>, Gateway recognizes it and applies the egress policy for bank.example.com. </p><p>5. After applying the egress policy, Gateway will rewrite the initially resolved address IP <code>100.80.10.10</code>, on the network traffic with the actual IP address <code>96.7.128.198</code> for <code>bank.example.com</code>, and send it out the egress IP address so that it can reach its destination.</p><p>The network traffic now has the correct destination IP address, and egresses according to the policy for bank.example.com, and all is well! </p>
    <div>
      <h2>Making it work for domains, categories and applications</h2>
      <a href="#making-it-work-for-domains-categories-and-applications">
        
      </a>
    </div>
    <p>So far, we’ve seen how the mechanism works with individual hostnames (i.e. Fully Qualified Domain Names (FQDNs) like <code>bank.example.com</code><u>)</u>. What about egress policies for domains and subdomains like <code>*.bank.example.com</code>? What about <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/domain-categories/#content-categories"><u>content categories</u></a> and <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/application-app-types/"><u>applications</u></a>, which are essentially sets of hostnames grouped together?</p><p>We are able to support these use cases because (returning to our example above) Gateway temporarily assigns the initial resolved IP address <code>100.80.10.10</code> to the hostname <code>bank.example.com</code> for a short period of time. After this short time period, the initial resolved IP address is released and returned into the pool of available addresses (in <code>100.80.0.0/16</code>), where it can be assigned to another hostname in the future.</p><p>In other words, we use a random dynamic assignment of initial resolved IP addresses, rather than statically associating a single initial resolved IP address with a single hostname. The result is that we can apply IPv4 egress policies to a very large number of hostnames, rather than being limited by the 65,536 IP addresses available in the <code>100.80.0.0/16</code> IPv4 address block.</p><p>Randomly assigning the initial resolved IP address also means that we can apply a single egress policy for a wildcard like <code>*.bank.example.com</code> to any traffic we happen to come across, such as traffic for <code>acmeco.bank.example.com</code> or <code>auth.bank.example.com</code>. A static mapping would require the customer to write a different policy for each individual hostname, which is clunkier and more difficult to manage.</p><p>Thus, by using dynamic assignments of initial resolved IP addresses, we simplify our customers’ egress policies and all is well!</p><p>Actually, not quite. There’s one other problem we need to solve.</p>
    <div>
      <h2>Landing on the same server</h2>
      <a href="#landing-on-the-same-server">
        
      </a>
    </div>
    <p>Cloudflare has an <a href="https://www.cloudflare.com/network"><u>extensive global network</u></a>, with servers running our software stack in over 330 cities in 125 countries. Our architecture is such that sharing strongly-consistent storage across those servers (even within a single data center) comes with some performance and reliability costs. For this reason, we decided to build this feature under the assumption that state could not be shared between any Cloudflare servers, even servers in the same data center.</p><p>This assumption created an interesting challenge for us. Let’s see why.</p><p>Returning to our running example, suppose that the end user’s DNS traffic lands on one Cloudflare server while the end user’s network traffic lands on a different Cloudflare server. Those servers do not share state.  Thus, it’s not possible to associate the mapping from hostname to its actual destination IP address (<code>bank.example.com</code> = <code>96.7.128.198</code>) which was obtained from the DNS traffic, with the initial resolved IP that is used by the network traffic (i.e. <code>100.80.10.10</code>). Our mechanism would break down and traffic would be dropped, as shown in the figure below.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/76uOsvToz6PnHVjprOKYGy/d978576f2a1d8b6a246431035ecf7a30/Landing_on_the_same_server.png" />
          </figure><p>We solve this problem by ensuring that DNS traffic and network traffic land on the same Cloudflare server. In particular, we require DNS traffic to go into the same tunnel as network traffic so that both traffic flows land on the same Cloudflare server. For this reason, egress policies by hostname are only supported when end users connect to the Cloudflare network using one of the following on-ramps:</p><ul><li><p>The WARP client (which we recently <a href="https://developers.cloudflare.com/cloudflare-one/changelog/warp/#2025-05-14"><u>upgraded</u></a> to send <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/configure-warp/route-traffic/warp-architecture/#overview"><u>DNS traffic inside the WARP tunnel</u></a>)</p></li><li><p>PAC files</p></li><li><p>Browser Isolation</p></li></ul><p>We are actively working to expand support of this feature to more onramps. </p>
    <div>
      <h2>What’s next?</h2>
      <a href="#whats-next">
        
      </a>
    </div>
    <p>There’s a lot more coming. Besides expanding support for more onramps, we also plan to extend this support to hostname-based rulesets in more parts of Cloudflare’s SASE. Stand by for more updates from us on this topic. All of these new features will rely on the “initial resolved IP” mechanism that we described above, empowering our customers to simplify their rulesets and enforce tighter security policies in their Cloudflare SASE deployments.</p><p>Don't wait to gain granular control over your network traffic: log in to your Cloudflare <a href="https://dash.cloudflare.com/"><u>dashboard</u></a> to explore the beta release of <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/egress-policies/"><u>egress policies</u></a> by hostname / domain / category / application and bolster your security strategy with <a href="https://developers.cloudflare.com/reference-architecture/diagrams/sase/"><u>Cloudflare SASE</u></a>.</p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Gateway]]></category>
            <category><![CDATA[Cloudflare One]]></category>
            <category><![CDATA[Egress]]></category>
            <category><![CDATA[SASE]]></category>
            <category><![CDATA[Zero Trust]]></category>
            <category><![CDATA[Access Control Lists (ACLs)]]></category>
            <category><![CDATA[Categories]]></category>
            <category><![CDATA[Hostnames]]></category>
            <guid isPermaLink="false">1NxtPefzr7flsiIe8gZ43L</guid>
            <dc:creator>Ankur Aggarwal</dc:creator>
            <dc:creator>Sharon Goldberg</dc:creator>
            <dc:creator>João Paiva</dc:creator>
            <dc:creator>Alyssa Wang</dc:creator>
        </item>
    </channel>
</rss>