DNS and Cloudflare Workers

I recently published a static HTML site on Workers Site.

account_id = "xxx"
name = "my-website"
type = "webpack"
workers_dev = true

[site]
bucket = "./dist"
entry-point = "workers-site"

[env.dev]
name = "my-website-dev"
route = "dev.mywebsite.com/*"
zone_id = "xxx"
account_id = "xxx"


[env.prod]
name = "my-website-prod"
route = "prod.mywebsite.com/*"
zone_id = "xxx"
account_id = "xxx"

The problem is when I deploy “prod” it doesn’t work, it says that could not resolve the DNS. Do I need to do anything on Cloudflare DNS previous of creating the Worker?

1 Like

You will need DNS entries for “dev” and “prod”. Otherwise it’s not a valid route.

If it’s just for Workers, and there’s no server associated with it, you can plug in a dummy IP address such as 192.0.2.1 and then make sure it’s set to :orange:.

1 Like