From 24616062db1d05d19498619c37f5883971fec275 Mon Sep 17 00:00:00 2001 From: Will Wiriawan Date: Tue, 1 Sep 2026 10:36:13 +0700 Subject: [PATCH] fix(tunnel): route dns with --overwrite-dns so re-provisioning repoints stale records --- src/tunnel/named-provision.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tunnel/named-provision.ts b/src/tunnel/named-provision.ts index 6264ec4..baaab96 100644 --- a/src/tunnel/named-provision.ts +++ b/src/tunnel/named-provision.ts @@ -157,7 +157,9 @@ export class ProcessCloudflaredAccount implements CloudflaredAccount { } async routeDns(tunnelName: string, hostname: string): Promise { - const result = this.run(["tunnel", "route", "dns", tunnelName, hostname]); + // --overwrite-dns repoints an existing CNAME at this tunnel; without it a + // stale record silently keeps serving a dead tunnel. + const result = this.run(["tunnel", "route", "dns", "--overwrite-dns", tunnelName, hostname]); if (result.ok || isBenignRouteError(`${result.stdout}\n${result.stderr}`)) return; throw new Error(result.stderr || result.stdout || `Unable to route ${hostname}`); }