Hostname management
Hostname management controls where your Turnstile widgets can be used by specifying which domains are authorized to load and execute your widgets. This security measure prevents unauthorized use of your widgets on domains that you do not control.
You can associate hostnames with your widget to control where it can be used via Hostname Management. Managing your hostnames ensures that Turnstile works seamlessly with your setup, whether you add standalone hostnames or leverage zones registered to your Cloudflare account.
By default, every widget requires at least one hostname to be configured. You cannot create a widget without specifying at least one authorized hostname.
When adding hostnames, follow these requirements:
- The hostname must be fully qualified domain names (FQDNs):
example.comorsubdomain.example.com - No wildcards are supported. You must specify each hostname individually.
Specifying a subdomain provides additional security by restricting widget usage.
For example, adding www.example.com as a hostname will allow widgets to work on:
www.example.comabc.www.example.com:8080(subdomains of the specified hostname).
However, it will not work on:
example.com(parent domain)dash.example.com(sibling subdomain)cloudflare.com(unrelated domain)
Existing widget
-
In the Cloudflare dashboard, go to the Turnstile page.
Go to Turnstile -
Select an existing widget.
-
Go to Settings.
-
Under Hostname Management, select Add Hostnames.
-
Add a custom hostname or choose from an existing hostname.
-
Select Add.
New widget
-
In the Cloudflare dashboard, go to the Turnstile page.
Go to Turnstile -
Select Add widget.
-
In the hostname field, enter your domain(s).
-
If you have zones registered with Cloudflare, you can select from existing zones
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/challenges/widgets/$WIDGET_ID" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "domains": ["example.com", "app.example.com", "api.example.com"] }'Free users are entitled to a maximum of 15 hostnames per widget.
Enterprise customers can have up to 200 hostnames per widget.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-