Cloudflare tunnels load balancing

I have a URL, i would like to route traffic using cloudflared tunnel.

As shown in picture, before setting up Cloudflare tunnels , i have 3 NGINX load balancers which will route to in round robin fashion.

I want to create 3 cloudflared tunnels before 3 nginx and route.

Cloudflared Tunnel 1 is working well on Machine 1.

When i try to set up tunnel on machine2, its failing saying “Failed to add route: code: 1003, reason: An A, AAAA, or CNAME record with that host already exists.”

I found that, CNAME entry for is already added when i setup tunnel1 on machine1(cloudflared tunnel route dns cloudflaretunnel1

Please help to resolve this issue. i want all 3 tunnels to be working and create a Cloudflare Loadbalancer for 3 tunnels in Cloudflare UIPreformatted text

So you’ll want to use replicas in this scenario as described or you could use load balancing instead if you need more steering options.

1 Like

I’m using Cloudflare Load Balancers with Cloudflare Tunnel connected origins as well. What you have to do is instead of using cloudflared to setup the CNAME DNS route, you’d have to setup the CNAME DNS manually. I touched on the error you get for CNAME on my Cloudflare Tunnel guide I wrote at (step 4)

As per documentation DNS record · Cloudflare Zero Trust docs, you can create the CNAME DNS record via command line. This will only work for the Cloudflare site zone that you authenticated the initial cloudflared login setup for in Step 1. Other Cloudflare site zones you intend to add to the Cloudflare Tunnel will have to have their CNAME DNS records added either manually or via Cloudflare DNS API.

If the CNAME already exists, you’ll get an error and need to manually edit and update the existing CNAME DNS record.

While mine was a different reason for the error (different hostnames), the solution is the same. You’d have to manually setup CNAME DNS for the other 2 CF Tunnels.

The easiest way though is to just setup Cloudflare origins using the actual CF Tunnel’s as the origin address, and setup a Host header override with the header value being your origin’s real domain name i.e. Then you don’t need to setup a CNAME DNS route to each CF Tunnel. Though useful to do anyway as a way to to directly access each CF Tunnel for diganostics/troubleshooting. But those CNAME names would have to be different from