Step-by-Step Guide: Secure Your Hostinger Domain with Cloudflare
Step 1: Sign Up or Log In to Cloudflare
-
Create an account or log in to your existing Cloudflare account at Cloudflare.
-
Once logged in, click “Add a Site” and enter your Hostinger domain (e.g.,
yourdomain.com
). -
Cloudflare will automatically scan your current DNS records. Once the scan is complete, click Continue to proceed.
Step 2: Update Nameservers in Hostinger
After Cloudflare scans your DNS records, it will provide two nameservers (e.g., ns1.cloudflare.com
and ns2.cloudflare.com
).
-
Log in to your Hostinger account and navigate to hPanel.
-
In the Domains section, click on your domain name.
-
Go to the DNS / Nameservers section and select Use Custom Nameservers.
-
Replace the current nameservers with the Cloudflare nameservers provided.
-
Save the changes. Keep in mind that DNS propagation may take up to 24-48 hours.
Step 3: Enable SSL/TLS for HTTPS Security
Cloudflare provides SSL/TLS encryption to ensure all traffic between users and your website is secure. Here’s how to enable it:
-
Go to the SSL/TLS tab in your Cloudflare dashboard.
-
Select the Full (Strict) SSL mode for the highest level of encryption:
-
Full (Strict): Ensures end-to-end encryption between Cloudflare and the server, requiring an SSL certificate on your Hostinger server.
-
Flexible SSL: Encrypts only traffic between the user and Cloudflare, not between Cloudflare and your server (not recommended).
Recommendation: Use Full (Strict) for better security.
-
-
Enable “Always Use HTTPS” to ensure visitors always access your site via HTTPS, preventing any HTTP traffic.
Step 4: Activate Web Application Firewall (WAF)
Cloudflare’s Web Application Firewall (WAF) protects your website from common vulnerabilities such as SQL injection, cross-site scripting (XSS), and more.
-
Navigate to the Firewall section in your Cloudflare dashboard.
-
Enable WAF to block malicious traffic and attacks.
-
Optionally, enable OWASP rules and Bot Fight Mode to improve security against automated threats.
Step 5: Enable DDoS Protection
One of Cloudflare’s primary security features is DDoS protection, which prevents large-scale Distributed Denial-of-Service attacks from disrupting your site.
-
DDoS protection is enabled by default in Cloudflare. Cloudflare automatically detects and mitigates attacks that target your website.
-
You can also enable Bot Fight Mode under the Security settings in Cloudflare to prevent malicious bots from accessing your site.
Step 6: Configure DNS Security with Cloudflare
Cloudflare offers DNS security features that can prevent DNS hijacking and other attacks:
-
In the DNS settings, make sure that DNSSEC is enabled. DNSSEC (Domain Name System Security Extensions) ensures that responses to DNS queries are verified and cannot be tampered with.
To enable DNSSEC:
-
Go to DNS settings in your Cloudflare dashboard.
-
Look for the DNSSEC section and enable it.
-
Follow the instructions to add DNSSEC records in your Hostinger account.
-
Step 7: Activate Rate Limiting and Bot Management
Cloudflare allows you to limit the number of requests that can be made to your site within a certain time frame, helping prevent brute-force attacks and abuse.
-
Navigate to the Firewall section and enable Rate Limiting for certain URL patterns (e.g., login pages) to block repeated attack attempts.
-
Enable Bot Management to detect and block malicious bots from scraping content or attempting attacks.
Step 8: Enable Automatic HTTPS Rewrites
To fix mixed content issues and ensure that all content is loaded over HTTPS, enable Automatic HTTPS Rewrites in Cloudflare:
-
Go to the SSL/TLS > Edge Certificates section in your Cloudflare dashboard.
-
Enable Automatic HTTPS Rewrites. This will automatically update any HTTP links to HTTPS, ensuring all resources are served securely.
Step 9: Set Up Security Headers
Cloudflare allows you to configure security headers that can help protect your website from common attacks.
-
Go to the Firewall section in your Cloudflare dashboard.
-
Enable the HTTP Strict Transport Security (HSTS) header to force all traffic over HTTPS.
-
Optionally, enable Content Security Policy (CSP) headers to reduce the risk of cross-site scripting attacks.
Step 10: Test Your Website’s Security
After setting up Cloudflare on your Hostinger domain, test the security of your website using tools like:
-
SSL Labs: Check if your SSL certificate is correctly installed and secure.
-
GTMetrix: Monitor your website’s performance and see if Cloudflare’s caching and security features are working properly.
Conclusion: Securing Your Hostinger Domain with Cloudflare
By following these steps, you will significantly enhance the security of your Hostinger domain with Cloudflare. Cloudflare’s security features, including SSL/TLS encryption, DDoS protection, Web Application Firewall, and more, will protect your site from various online threats. Additionally, Cloudflare helps improve website performance, ensuring that your users experience a fast and secure browsing experience.
With Cloudflare’s powerful tools and Hostinger’s reliable hosting, your website will be well-secured against attacks and other vulnerabilities.