Setup
In order to enable automatic mitigation of random prefix attacks:
-
Set up DNS Firewall.
-
Send a
PATCH
request to update your DNS Firewall cluster.
At least one of the following token permissions is required:Required API token permissions
DNS Firewall Write
Update DNS Firewall Cluster curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/dns_firewall/$DNS_FIREWALL_ID" \--request PATCH \--header "X-Auth-Email: $CLOUDFLARE_EMAIL" \--header "X-Auth-Key: $CLOUDFLARE_API_KEY" \--json '{"attack_mitigation": {"enabled": true,"only_when_upstream_unhealthy": true}}'
Once you receive a 200
success response from the API, queries identified as being part of a random prefix attack will receive a REFUSED
response.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- 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