Hostname 'www.<my-domain>.com' already has externally managed DNS records

{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "project-name",
"main": "./dist/_worker.js/index.js",
// Update to today's date
"compatibility_date": "2025-03-25",
"compatibility_flags": ["nodejs_compat"],
"assets": {
"binding": "ASSETS",
"directory": "./dist"
},
"observability": {
"enabled": true
},
"vars": {},
"hyperdrive": [
{
"binding": "HYPERDRIVE",
"id": <hyperdrive-id>,
"localConnectionString": <local-connection-string>
}
],
"routes": [
{
"pattern": "www.<my-domain>.com",
"custom_domain": true
}
]
}
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "project-name",
"main": "./dist/_worker.js/index.js",
// Update to today's date
"compatibility_date": "2025-03-25",
"compatibility_flags": ["nodejs_compat"],
"assets": {
"binding": "ASSETS",
"directory": "./dist"
},
"observability": {
"enabled": true
},
"vars": {},
"hyperdrive": [
{
"binding": "HYPERDRIVE",
"id": <hyperdrive-id>,
"localConnectionString": <local-connection-string>
}
],
"routes": [
{
"pattern": "www.<my-domain>.com",
"custom_domain": true
}
]
}
I'm trying to configure a simple test site. I have a custom domain, and previously added it to Cloudflare. So DNS records are populated. But then adding "routes" to wrangler, when I deploy, I get the error Hostname 'www.<my-domain>.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] Are there specific DNS entries I need to delete to get this working?
1 Reply
stu
stuOP6d ago
Following up on this, I deleted my A records and CNAME for www. Then deployed with the route pattern "<my-domain>.com". This worked. I'd like to redirect everything to www, but can't seem to get it working correctly.

Did you find this page helpful?