From d19da6767a606195a6f2410bde1da8586009c001 Mon Sep 17 00:00:00 2001 From: Sudarsan Reddy Date: Tue, 20 Dec 2022 11:26:27 +0000 Subject: [PATCH] TUN-7021: Fix proxy-dns not starting when cloudflared tunnel is run This PR starts a separate server for proxy-dns if the configuration is available. This fixes a problem on cloudflared not starting in proxy-dns mode if the url flag (which isn't necessary for proxy-dns) is not provided. Note: This is still being supported for legacy reasons and since proxy-dns is not a tunnel and should not be part of the cloudflared tunnel group of commands. --- cmd/cloudflared/tunnel/cmd.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/cloudflared/tunnel/cmd.go b/cmd/cloudflared/tunnel/cmd.go index 6d3deab7..e691f93f 100644 --- a/cmd/cloudflared/tunnel/cmd.go +++ b/cmd/cloudflared/tunnel/cmd.go @@ -195,6 +195,13 @@ func TunnelCommand(c *cli.Context) error { return runClassicTunnel(sc) } + if c.String("proxy-dns") != "" { + // NamedTunnelProperties are nil since proxy dns server does not need it. + // This is supported for legacy reasons: dns proxy server is not a tunnel and ideally should + // not run as part of cloudflared tunnel. + return StartServer(sc.c, buildInfo, nil, sc.log) + } + return errors.New(tunnelCmdErrorMessage) }