Cloudflare DDoS protection only filters traffic that passes through Cloudflare. If an attacker learns your server’s real IP address, they can send requests straight to it and skip every Cloudflare rule. To close that gap, proxy every web record, remove the records and history that leak the IP, and let ports 80 and 443 accept traffic only from Cloudflare.
Most people stop at the orange cloud. It is a good first step, and it is not the whole job.
This guide walks through the full setup on any server, then shows the exact path on xCloud. If you are new to DDoS basics, start with our guide to preventing DDoS attacks.
TL;DR
Short on time? Here is the whole guide in a few lines:
- Cloudflare protects names, not IPs. A request sent to your server IP never touches Cloudflare.
- Proxy every record that serves a website (A and CNAME), so DNS lookups return Cloudflare addresses.
- Close the leaks: DNS-only records on the same IP, mail records, staging domains and old DNS history.
- Lock the firewall: allow ports 80 and 443 only from Cloudflare’s IP ranges, then remove the open rules.
- Restore real visitor IPs in your logs, or your security tools will block Cloudflare itself.
- On xCloud, all of this is a few rules in Security → Firewall Management, and SSH access for xCloud is not affected.
The Finding: a Proxied Site Is Still Open Until the Firewall Says Otherwise
Here is the part that trips people up. Turning on the Cloudflare proxy changes what DNS answers. It does not change who your server accepts connections from.

A new server on xCloud starts with three firewall rules: SSH on port 22, HTTP on port 80 and HTTPS on port 443, each open to every IP address. That default is right for a site that is not behind a proxy. Once a site sits behind Cloudflare, those open web rules are the door that lets attackers go around it.
Cloudflare’s own documentation says the same thing: if someone finds your server’s real IP address through historical DNS records or mail server configuration, they can send traffic directly to your server, so Cloudflare recommends that you block all traffic that does not come from Cloudflare IP addresses.
| What you did | What DNS shows | Can attackers reach the server directly? |
|---|---|---|
| Nothing (DNS only, grey cloud) | Your server IP | Yes, and they know where it is |
| Proxied the site record only | Cloudflare IPs | Yes, if the IP leaks anywhere else |
| Proxied records and closed leaks | Cloudflare IPs | Harder to find, still open if found |
| All of the above plus firewall locked to Cloudflare | Cloudflare IPs | No: direct web requests are dropped |
Only the last row actually closes the bypass. The rest of this guide gets you there.
Why Your Server IP Matters
Cloudflare DDoS protection is strong. As of 23 November 2026, Cloudflare’s plans page lists unmetered DDoS protection on its Free, Pro, Business and contract plans. The catch is that this protection lives at Cloudflare’s edge.
Think of it like a building with a security desk in the lobby. The desk checks everyone who walks in the front door. If the loading dock at the back is unlocked and someone knows where it is, the desk never sees them.
Your server IP is the loading dock. Attacks sent to it skip Cloudflare’s firewall rules (WAF), rate limits, bot checks and Under Attack Mode. They also land on a single server with a fixed amount of bandwidth and CPU, which is exactly what a flood is built to exhaust.
Step 1: Proxy Every Record That Serves a Website
Start in your DNS zone. Every A and CNAME record that serves web traffic should be Proxied (orange cloud), so a lookup returns a Cloudflare address instead of yours.
Check it from your own computer:
dig +short example.com
dig +short www.example.com
Both should return Cloudflare addresses, not SERVER_IP. Repeat for every subdomain that points at the same server.
If you connect your Cloudflare account to xCloud, xCloud can create these records for you. With Cloudflare managed SSL, xCloud sets the record to Proxied. With xCloud’s free SSL certificate, it sets the record to DNS only, which leaves that site’s IP visible. The full setup is in 👉 Integrate Cloudflare for DNS management.
Step 2: Close the Leaks That Reveal Your IP
Proxying the main record is not enough if the same IP shows up somewhere else. Cloudflare’s guide to exposed IP addresses warns that a DNS-only record pointing to the same server reveals the origin to anyone who looks it up.
Work through this list:
| Leak | How it exposes the IP | What to do |
|---|---|---|
DNS-only records on the same server (mail, ftp, direct, dev) |
A lookup returns SERVER_IP |
Proxy them if they serve HTTP, delete them if unused, or move the service elsewhere |
| Mail sent from the web server | Mail headers and SPF records can name the sending IP | Send through a separate mail service instead of the web server |
| Staging or demo sites on the same server | A demo domain usually points straight at the server | Check with dig, and keep test sites on a separate server when it matters |
| Old DNS history | Public DNS history sites keep the IP you used before Cloudflare | Lock the firewall (Step 3). If the risk is high, move to a fresh server IP |
| Server IP in your code or pages | Hardcoded links, API callbacks or error pages show the IP | Use your domain everywhere, never the bare IP |
The honest truth: once an IP has been public, you cannot pull it back out of DNS history. That is why Step 3 matters more than any of the cleanup above.
Step 3: Only Accept Web Traffic From Cloudflare
This is the step that actually stops the bypass. Your server should accept ports 80 and 443 only from Cloudflare’s published IP ranges and drop everything else.
As of 23 November 2026, Cloudflare publishes 15 IPv4 ranges:
173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/13,104.24.0.0/14,172.64.0.0/13,131.0.72.0/22
Always copy the current list from Cloudflare’s page before you add it, because Cloudflare updates it from time to time.
Before you lock anything
- Every site on the server must be proxied through Cloudflare. A site with a DNS-only record stops loading once ports 80 and 443 are limited.
- Keep SSH open to xCloud’s IP addresses. Your panel connects over SSH, so web-port rules do not affect it. The full list of what must stay open is in 👉 Lock down your server without breaking xCloud.
- Use your server’s IPv4 address for the proxied records. The steps below allow Cloudflare’s IPv4 ranges only. Remove AAAA records for these sites, or Cloudflare may reach your server over IPv6 and get blocked.
On xCloud: Security → Firewall Management
Open your server, then go to Security → Firewall Management. You will see the default SSH, HTTP and HTTPS rules.

- Click Add New Rule. Name it
Cloudflare HTTPS, set Port to443, paste the comma-separated IPv4 list into IP Address (Optional), choose TCP as the Protocol and Allow as the traffic option. Click Add Rule. - Add a second rule the same way for port
80, namedCloudflare HTTP. - Check that your sites still load through their domains.
- Delete the open HTTPS rule, then the open HTTP rule. xCloud may show a risk warning first; read it and confirm.
- Load each site again. Then try
http://SERVER_IPfrom your own computer: it should time out instead of answering.
The IP Address (Optional) field accepts single IPs and ranges in ip/subnet form (such as 173.245.48.0/20), separated by commas, so the whole IPv4 list fits in one rule. Add the new rules first and delete the old ones second, so your sites never sit behind no open rule at all. More on the screen itself is in 👉 How to configure Firewall Management.
If you also use a firewall at your server provider (Hetzner, Vultr, DigitalOcean, AWS and others), apply the same limit there. Traffic that the provider’s firewall drops never reaches your server.
Step 4: Keep Real Visitor IPs in Your Logs
Behind the proxy, every request reaches your server from a Cloudflare address. Logs fill up with the same few IPs, and login protection can end up blocking Cloudflare itself, which locks out real visitors. Cloudflare’s documentation flags the same risk: blocking its IPs, even by accident, stops visitor traffic from reaching your site.
The fix is to tell the web server to use the visitor’s real address, which Cloudflare sends along with every request.
| Server type on xCloud | What to do |
|---|---|
| NGINX, one site | Site → Tools → Nginx Customization → Add New NGINX → template Show Real IP (CloudFlare-Proxied) |
| NGINX, every site on the server | Server → Management → Commands → Run Custom Command with the script from the docs |
| OpenLiteSpeed | Nothing: xCloud restores the real IP by default |
| One Click Apps | Nothing: the app already receives the real IP. Do not add the template, or the NGINX check fails |

Both NGINX methods are covered step by step in 👉 Show visitor real IP behind Cloudflare proxy.
Common Pitfalls
- Cloudflare error 522 after locking the firewall. Cloudflare cannot reach your server on 80 or 443, or an AAAA record is still set. Check that the Cloudflare rules exist on both ports and that your provider’s firewall allows the same ranges. See How to fix Cloudflare 522 errors.
- One site went offline, the rest work. That site’s record is DNS only. Proxy it, or move it to a server that is not locked.
- Cloudflare Tunnel instead of open ports. xCloud sets up sites to be reached on ports 80 and 443, so the simplest setup is the Cloudflare proxy with a firewall locked to Cloudflare. Our Cloudflare Tunnel explainer covers where a tunnel does fit.
- Locking SSH and web ports in one go. Change one thing at a time. If the server shows Disconnected, the lock-down guide has the recovery steps.
What This Does Not Do (and How to Undo It)
Hiding your IP and locking the firewall stops attacks that skip Cloudflare. It does not stop a flood that targets your server’s network as a whole: traffic still arrives at your provider before your firewall drops it. Large network-level floods are your server provider’s problem to filter, so check what your provider offers.
It also does nothing for non-web services. Cloudflare’s normal proxy covers HTTP and HTTPS only, so SSH, mail and database ports need their own protection, such as allowing SSH only from your own IP addresses (see the lock-down guide) and keeping databases closed to the internet.
To undo it, add the open HTTP and HTTPS rules back in Firewall Management, then delete the two Cloudflare rules. Your sites answer on the server IP again straight away.
Put Cloudflare in Front of Every Site on xCloud
Think of security in layers. Your host secures the server: updates, firewall, SSH and backups. Cloudflare filters traffic before it arrives: DDoS floods, bad bots and attack patterns stop at the edge. A site needs both, and the steps above connect them.
On xCloud you have two ways to do it:
| Your own Cloudflare account (integration) | Cloudflare Enterprise add-on | |
|---|---|---|
| Account | Yours, connected with an API Token in Settings → Integrations → Cloudflare | No Cloudflare account needed |
| DNS | Nameservers move to Cloudflare | Keep your DNS provider and nameservers; add the records xCloud shows |
| Protection | Your Cloudflare plan’s features; WAF rules and Under Attack Mode from the site’s Security page | Enterprise WAF, DDoS protection, rate limiting, Under Attack Mode, edge page caching and image optimization |
| Price | Cloudflare’s own plan price | $5 a month per domain. One purchase covers the root domain, www and first-level subdomains such as blog.example.com. Each domain includes 100 GB of bandwidth a month. If it runs out, Cloudflare Enterprise turns off for that domain until you add bandwidth or the next month starts |
| Firewall lock-down | You add the Cloudflare rules (Step 3) | You add the Cloudflare rules (Step 3) |
✅ With either path, xCloud handles the DNS records and keeps SSH access separate from your web rules.
❌ What xCloud does not do today: it does not lock ports 80 and 443 to Cloudflare for you. That is the manual step in Firewall Management above. The Enterprise add-on has no free trial.
The Enterprise add-on also shows Security events per domain, so you can see what Cloudflare blocked before it reached your server.

👉 Activate it with How to activate the Cloudflare Enterprise add-on, or read what it includes on the Cloudflare Enterprise page. For edge rules beyond the basics, see our guide to Cloudflare firewall rules and our wider web hosting security best practices. To compare plans, visit xCloud pricing.
Close the Back Door This Week
Cloudflare’s DDoS protection is only as good as the path traffic takes to your server. If the server IP still answers web requests from anyone, an attacker who finds it skips everything you set up at the edge.
This week, run dig on every hostname, clean up the records that leak your IP, and add the two Cloudflare rules in Firewall Management before you remove the open ones. Then restore real visitor IPs so your logs and login protection keep working. It is an hour of work that turns the orange cloud from a disguise into a real wall.
If you have found this blog helpful, feel free to subscribe to our blogs for valuable tutorials, guides, knowledge, and tips on web hosting and server management. You can also join our Facebook community to share insights and engage in discussions.
Frequently Asked Questions
Can attackers bypass Cloudflare DDoS protection?
Yes, if they know your server’s IP address and your server still accepts web traffic from anyone. Requests sent straight to the IP never pass through Cloudflare, so none of its filtering applies. Allowing ports 80 and 443 only from Cloudflare’s IP ranges closes that path.
Does the orange cloud hide my server IP on its own?
It hides the IP from DNS lookups of that record only. Your IP can still leak through DNS-only records on the same server, old DNS history, or a staging domain. Close those leaks and lock the firewall to Cloudflare’s ranges as well.
Will limiting ports 80 and 443 to Cloudflare disconnect my server from xCloud?
No. xCloud manages your server over SSH, not over ports 80 or 443. Keep SSH open to xCloud’s IP addresses and the server stays Connected. Every site on that server must be proxied through Cloudflare, or it stops loading.
Why do my logs show Cloudflare IPs instead of visitor IPs?
Behind the proxy, every request reaches your server from a Cloudflare address. On NGINX, add the Show Real IP (CloudFlare-Proxied) template in Tools → Nginx Customization. OpenLiteSpeed servers on xCloud restore the real IP by default.
Do I need a Cloudflare account to use Cloudflare Enterprise on xCloud?
No. The Cloudflare Enterprise add-on runs through xCloud: you keep your DNS provider and nameservers and add the records xCloud shows. It costs $5 a month per domain. One purchase covers the root domain, www and first-level subdomains such as blog.example.com. Each domain includes 100 GB of bandwidth a month. If it runs out, Cloudflare Enterprise turns off for that domain until you add bandwidth or the next month starts. See How to add Cloudflare Enterprise bandwidth.
My server IP is already public. What now?
Lock ports 80 and 443 to Cloudflare’s IP ranges first, because that stops direct attacks even when the IP is known. If you also want a new IP, move the sites to a fresh server, proxy them from the start, and never publish the new IP in a DNS-only record.
Last updated November 25, 2026
← All articles