override_existing_dns_record

@Vero @SuperHelpflare We deployed our frontend to workers assets, but we have A record for our domain and when we trying to configure Custom domain it showing error:(
already has externally managed DNS records (A, CNAME, etc). Either delete them, try a different hostname, or use the option 'override_existing_dns_record' to override.
i tried to find any information regarding override_existing_dns_record but didn't find any documentation regarding that https://developers.cloudflare.com/search/?query=override_existing_dns_record how we can override DNS record to Workers without downtime?
8 Replies
Hard@Work
Hard@Work3d ago
Is this in CI?
Nikita
NikitaOP3d ago
no in UI but same issue in CI right now we managing it via worker routes but it working not perfect cause part of requests going to old frontend ( we have route example.com/* but request to www.example.com going to old frontend but www should redirect CNAME www.example.com -> example.com so i created second route www.example.com, but it looks strange... managing DNS via routes instead of dns so we have now strange situation, example.com A record -> IP address www.example.com CNAME -> example.com routes: example.com/* -> worker www.example.com/* -> worker
Hard@Work
Hard@Work3d ago
I do see that if you use wrangler, it should ask if you want to override Not sure if the Dashboard does that though
Nikita
NikitaOP3d ago
using but it was return error, let me check 1 min hm.. looks like we didn't try to deploy custom domain via wrangler on prod but question still same how i can override without downtime A record to custom domain in worker assets deployment? let me share stage example of wrangler name = "example-stage" compatibility_date = "2025-01-01" workers_dev = false [placement] mode = "smart" [assets] directory = "./build" not_found_handling = "single-page-application" [env.stage] name = "example-stage" routes = [ { pattern = "example.com", custom_domain = true } ] @Hard@Work ^
Hard@Work
Hard@Work3d ago
So what happens if you deploy?
Nikita
NikitaOP3d ago
let me check 1 min
Nikita
NikitaOP3d ago
Total Upload: 0.34 KiB / gzip: 0.24 KiB No bindings found. Uploaded example-prod (17.93 sec) ✘ [ERROR] A request to the Cloudflare API (/accounts/xxxxxxxx/workers/scripts/example-prod/domains/records) failed. Hostname 'example.com' already has externally managed DNS records (A, CNAME, etc). Either delete them, try a different hostname, or use the option 'override_existing_dns_record' to override. [code: 100117] If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose
GitHub
Build software better, together
GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.
From An unknown user
From An unknown user
From An unknown user
Nikita
NikitaOP3d ago
so problem the same:( @Hard@Work ^

Did you find this page helpful?