How to Use Cloudflare With Hostinger (DNS, SSL, and Common Fixes)
If your website is hosted on Hostinger and you want to use Cloudflare, the process is simple: add your domain to Cloudflare, copy your current DNS records, then change your domain nameservers to Cloudflare and verify the DNS is correct. After that, set the right SSL mode to avoid errors and redirect loops. This Cloudflare Hostinger setup works for most sites.
This guide covers the safest setup for WordPress, custom websites, and typical Hostinger deployments, plus quick fixes for the most common Cloudflare errors.
Before you start (important)
- Know where your domain is registered: It might be Hostinger, Middlehost, or another registrar. Nameservers are changed at the registrar.
- Collect your Hostinger server details: You will need your website IP address (or the DNS target Hostinger provides). If you are not sure, check your Hostinger panel for the website IP and any recommended DNS records.
- Decide what Cloudflare will manage:
- DNS only: Cloudflare manages DNS, but does not proxy traffic (gray cloud). Good if you just want DNS and email stability.
- DNS + proxy: Cloudflare proxies HTTP/HTTPS (orange cloud) for caching, WAF, and DDoS protection. Recommended for websites, but SSL must be configured correctly.
Step 1: Add your domain to Cloudflare
- Create a Cloudflare account (or log in).
- Click Add a site and enter your domain (example:
example.com). - Select a plan (Free is fine for most sites).
- Cloudflare will scan existing DNS records. Do not rush this step, you must confirm the records are correct.
Step 2: Copy DNS records (avoid downtime)
Downtime usually happens because DNS records were missing after switching nameservers. Before you switch, make sure Cloudflare has all critical records.
DNS records you usually need
- Website: An A record for
@(root domain) pointing to your Hostinger website IP, and a CNAME forwwwpointing to@(or to the hostname Hostinger provides). - Email: MX records plus SPF (TXT), DKIM (TXT), and DMARC (TXT). If you use Gmail or Microsoft 365, ensure those records match your provider.
- Other services: Any subdomains you use, like
cpanel,webmail,ftp,autodiscover, or an app likeapi.
Example DNS setup (typical website)
Use this as a pattern. Replace values with what Hostinger shows for your website.
| Type | Name | Value | Proxy |
|---|---|---|---|
| A | @ | Hostinger website IP | Proxied (orange) for websites |
| CNAME | www | @ | Proxied (orange) for websites |
| TXT | @ | SPF record (if email is used) | DNS only |
| MX | @ | Mail server targets | DNS only |
Tip: never proxy mail-related hostnames (like mail, smtp, imap). Keep them DNS only (gray cloud). | |||
Step 3: Change nameservers to Cloudflare
After you confirm the DNS records inside Cloudflare, you can switch nameservers at your domain registrar.
- In Cloudflare, copy the two nameservers it provides (example format:
alex.ns.cloudflare.com,lisa.ns.cloudflare.com). - Go to your registrar and open your domain management page.
- Replace the current nameservers with the Cloudflare nameservers.
- Save changes.
If your domain is registered at Middlehost, follow this guide: How to Change Nameservers.
Step 4: Verify DNS is correct after propagation
- Nameserver propagation: usually minutes to a few hours, sometimes up to 24 hours.
- What to check: your domain resolves to the right IP, and
wwwloads the same site as the root domain. - Email check: confirm MX records are present and unchanged.
Step 5: Configure SSL/TLS the safe way (avoid 525, 526, redirect loops)
Most Cloudflare + Hostinger issues are SSL mode mismatches. Here is the safest baseline:
- Recommended: Full (strict) if your origin (Hostinger) has a valid SSL certificate installed.
- Temporary fallback: Full if your origin certificate is still provisioning.
- Avoid: Flexible for WordPress and most modern sites. It often causes redirect loops and login/cookie issues because the origin stays HTTP.
If you recently changed nameservers and now see SSL errors, also review: ERR_SSL_VERSION_OR_CIPHER_MISMATCH after changing nameservers to Cloudflare.
Step 6: Decide what should be proxied (orange cloud) vs DNS only
Use Cloudflare proxy for your website hostnames, and keep infrastructure and email records DNS only.
- Proxy (orange cloud):
@,www, and public web apps likeapporblog. - DNS only (gray cloud): mail records (MX, SPF, DKIM, DMARC),
mail,smtp,imap, and any service that does not run on HTTP/HTTPS.
WordPress notes (Hostinger + Cloudflare)
- Cache: If your site uses LiteSpeed + LSCache, do not enable multiple overlapping caches without a plan. Cloudflare cache and LSCache can work together, but configure cache rules carefully for dynamic pages like checkout and account pages.
- Login and admin: Exclude
/wp-adminand/wp-login.phpfrom aggressive caching rules. - Performance limits: If your WordPress site hits CPU, RAM, or inode limits, Cloudflare can reduce load, but it will not fix an underpowered plan. For consistent performance, consider a plan with more resources and modern stack (LiteSpeed, NVMe, and enough CPU/RAM). See web hosting plans or cloud hosting.
Troubleshooting: common Cloudflare errors with Hostinger
| Problem | What it usually means | Fix |
|---|---|---|
| Error 521 | Cloudflare cannot connect to your origin web server. | Confirm the origin is online, verify DNS points to the correct Hostinger IP, and check if the origin firewall is blocking Cloudflare IPs. You can temporarily set the A/CNAME record to DNS only to test direct origin access. |
| Error 525 | SSL handshake failed between Cloudflare and origin. | Set SSL/TLS to Full or Full (strict) and ensure a valid SSL certificate is installed on the origin. Avoid Flexible for WordPress. |
| Error 526 | Origin certificate is invalid in Full (strict) mode. | Install a valid certificate on the origin (or use a Cloudflare Origin Certificate). Temporarily switch to Full while you fix the origin SSL. |
| Too many redirects | HTTPS redirect rules conflict (Cloudflare settings vs WordPress vs host). | Avoid Flexible, set Full (strict), and ensure only one place enforces HTTPS (prefer origin + Full (strict)). Also verify WordPress site URL is https. |
| Universal SSL pending | Cloudflare has not issued an edge certificate yet. | Wait for issuance (can take time), confirm DNS is active on Cloudflare, and do not keep changing settings repeatedly. Use Full mode if origin SSL exists. |
| Site not loading after nameserver change | Missing or wrong DNS records in Cloudflare. | Re-check A record for @ and CNAME for www, plus any required subdomains. Confirm you copied email records if email is used. |
FAQs
Should I use Hostinger DNS or Cloudflare DNS?
If you want Cloudflare features like caching, WAF, and DDoS protection, use Cloudflare nameservers and manage DNS there. If you only need basic DNS and want fewer moving parts, keeping DNS at your registrar or Hostinger can be simpler. Either option can work, but do not split authority between two DNS providers.
Will Cloudflare make my Hostinger website faster?
Often yes, especially for global visitors and image-heavy sites. Cloudflare can cache static assets, reduce latency, and block abusive traffic. However, it will not fix slow PHP, heavy plugins, or low server resources like limited CPU and RAM. For WordPress, use smart caching and keep dynamic pages excluded.
Do I need to change anything in Hostinger after switching to Cloudflare?
Usually no. Most changes happen in Cloudflare DNS and SSL settings. In some cases, you may need to confirm your domain is added to your hosting account, ensure the origin SSL is installed, and verify any redirects. If you proxy traffic through Cloudflare, make sure the origin is not blocking Cloudflare IPs.
Can I use Cloudflare with email on my domain?
Yes. Keep email-related records as DNS only: MX, SPF, DKIM, and DMARC. Do not proxy mail hostnames like smtp or imap. If email stops working after switching to Cloudflare, it is usually because MX records were missing or incorrect, so re-check the DNS zone in Cloudflare.
What is the safest Cloudflare SSL mode for WordPress on Hostinger?
Full (strict) is the safest when your origin has a valid SSL certificate, because it keeps end-to-end HTTPS and prevents downgrade issues. Full can work temporarily if the origin certificate is still provisioning. Avoid Flexible for WordPress because it commonly triggers redirect loops and mixed-content behavior.