💡When running `cloudflared tunnel route dns tunnel-name tunnel.x.com` use the x.com zone
Describe the feature you'd like Currently to create a tunnel you have to run the following commands (dx is already very bad, should be 1 command)
cloudflared tunnel create tunnel-name
cloudflared tunnel route dns tunnel-name tunnel.example.com
cloudflared tunnel run --url http://localhost:5467 tunnel-name
This won't create a tunnel on tunnel.example.com if for some reason you used the cloudflared on another domain previously (for example x.com), instead it will create one on tunnel.example.com.x.com
Describe alternatives you've considered Use the website with domain example.com if i am trying to create a tunnel there, not tunnel.example.com.x.com
Additional context
Maybe you have to run cloudflared tunnel login again? But there is only 1 global cloudflared config at /Users/user/.cloudflared/cert.pem, this doesn't make sense
I think i managed to get this working, congrats on making the most user hostile cli i ever used, and i used a lot of clis
- Create the tunnel on the cloudflare website, the cli is useless, it will use whatever domain you selected the first time you logged in
- Now you have to download another tunnel token even if you already are logged in, because why not
- To do this run
cloudflared tunnel token --cred-file .cloudflared/tunnel.json tunnel-name - Now create a file
.cloudflared/config.ymland add the contents
tunnel: tunnel-name
credentials-file: ./.cloudflared/tunnel.json
- Now you can finally run the tunnel with
cloudflared tunnel --config ./.cloudflared/config.yml run --url http://localhost:8040 tunnel-name. Notice how you have to pass the config manually and not after run because otherwise it breaks. Cloudflared only searches~/.cloudflaredbecause everyone knows non reproducible user based global configs are the best
Apparently they still haven't fully migrated from the legacy zone specific tunnels. This problem has existed for at least three years:
- Multiple domains over tunnel
- New Tunnel setup suffixes unwanted previous domain
- Cloudflare tunnel with second domain issue
- Cloudflare Tunnel Route DNS Pulls Different Zone
Obviously using the GUI is not a solution, it's just a workaround. I'm tired of clicking around on the web page to add/remove public hostnames.