Connect Namecheap Domain to Hostinger Through StackPath CDN

by Fahim

Pointing DNS straight from your domain registrar to shared hosting leaves your origin exposed to every traffic surge, scraper, and regional latency spike. Dropping StackPath CDN between a Namecheap domain and a Hostinger origin creates a fast, shielded delivery layer for your web apps and WordPress sites.

Getting this three-way setup right can be finicky. One misplaced CNAME, a forgotten Host header, or mismatched SSL certificates will immediately trigger 521 Origin Down errors or an infinite redirect loop. Here is the exact, battle-tested setup I use to hook up Namecheap, StackPath, and Hostinger without downtime.

Terminal screen showing HTTP curl header response verifying CDN edge caching
Terminal screen showing HTTP curl header response verifying CDN edge caching

How the Three-Way DNS and CDN Architecture Works

Before jumping into dashboards, make sure you have the traffic flow clear in your head. When everything is wired up properly, a request travels like this:

  1. Visitor types your domain name into their browser.
  2. Namecheap DNS resolves your root domain to StackPath’s Anycast edge IP or CNAME target.
  3. StackPath Edge Server checks its local cache. If the static asset is already cached, it serves the file immediately—usually in under 25ms.
  4. Cache Miss or Dynamic Request: StackPath proxies the request back to your Hostinger Origin Server IP over HTTPS.
  5. Hostinger Server executes your PHP worker, runs the MySQL query, and passes generated HTML back to StackPath.
  6. StackPath delivers the response to the visitor and stores cacheable static assets at the edge based on your caching headers.

If you used to point Namecheap DNS directly to Hostinger, you are moving the front door. Hostinger will no longer handle raw public traffic directly; it will only talk to StackPath’s edge nodes.

Step 1: Prepare the Origin Domain in Hostinger hPanel

Hostinger needs an active virtual host on its LiteSpeed web server to map incoming requests to your actual document root. If you skip this, Hostinger will serve a 404 or a generic holding page the second StackPath queries your origin IP.

  1. Log into your Hostinger hPanel.
  2. Navigate to Websites > Add Website.
  3. Pick your platform (WordPress or an empty PHP site) and enter your Namecheap domain (e.g., example.com).
  4. Once provisioned, open the site dashboard in hPanel and check the Server details sidebar.
  5. Copy the Website IP address (like 185.199.110.153). This is your Hostinger Origin IP.

While in hPanel, generate a free Let’s Encrypt SSL certificate through Hostinger’s Security settings. Even though StackPath handles SSL at the edge, you still need an active certificate on Hostinger to run Full Origin SSL encryption between the CDN and your origin.

If you are running dynamic apps that lean heavily on the origin backend, consider taking a moment to increase your PHP memory limit on Hostinger so origin pulls do not time out under load.

Step 2: Create and Configure the StackPath CDN Site

Now that Hostinger has a virtual host ready to catch requests, create the delivery pipeline in StackPath.

  1. Log into your StackPath dashboard.
  2. Click Create Site > select CDN (or CDN + WAF if you want edge firewall protection).
  3. Enter your apex domain (e.g., example.com) as the Site Name.
  4. Under Origin Type, pick IP Address.
  5. Paste your Hostinger Website IP address into the Origin IP field.
  6. Set the Origin Port to 443 for HTTPS (or 80 if you have not set up origin SSL yet, though you should stick to 443).

Once created, StackPath outputs an Edge Address (a CNAME like example.stackpathdns.com) alongside Anycast Edge IP addresses. Copy that edge CNAME string.

Step 3: Fix the Host Header and Origin SSL Settings

This single setting trips up most developers. When StackPath requests a page from your Hostinger origin IP, it sends an HTTP Host header. If StackPath forwards the origin IP or the CDN hostname instead of your real domain, Hostinger will reject the connection with a 403 Forbidden or drop you onto a default parking page.

Inside your StackPath Site dashboard:

  1. Go to CDN > Origin settings.
  2. Find the Origin Host Header option.
  3. Set it to Specify a Host Header and manually enter your domain: example.com.
  4. Set Origin Pull Protocol to HTTPS Only.
  5. Turn on Origin SSL Verification if Hostinger has a valid certificate active.

Now issue the edge certificate inside StackPath:

  1. Click EdgeSSL in the StackPath sidebar.
  2. Select Generate Cert (StackPath will issue a free Let’s Encrypt certificate for the edge).
  3. Include both example.com and www.example.com.

Step 4: Update DNS Records in Namecheap Advanced DNS

With Hostinger ready and StackPath configured, point Namecheap to StackPath’s edge servers. Leave your MX, TXT, and mail records untouched so email keeps running without interruption.

  1. Log into Namecheap and open your Domain List.
  2. Click Manage next to your domain, then open the Advanced DNS tab.
  3. Review your Host Records table. Delete any existing A Record pointing straight to Hostinger’s IP.
  4. Create an ALIAS or ANAME record for the root (@) pointing to your StackPath edge address:

Here is what your record values should look like in Namecheap:

# Root domain alias
Type: ALIAS Record
Host: @
Value: example.stackpathdns.com.
TTL: 1 min (or Automatic) # WWW subdomain routing
Type: CNAME Record
Host: www
Value: example.stackpathdns.com.
TTL: 1 min (or Automatic)

If you have custom mail authentication configured, make sure your SPF and DKIM records in Namecheap stay right where they are. Updating root web records will not touch TXT-based email verification.

Step 5: Troubleshoot Redirect Loops and 521 Errors

If you open the site after updating DNS and hit ERR_TOO_MANY_REDIRECTS, your SSL configurations on StackPath and Hostinger are fighting each other.

The Redirect Loop Fix

This loop happens when StackPath pulls from Hostinger over port 80 (HTTP), but Hostinger has an .htaccess rule forcing HTTPS (port 443). Hostinger fires a 301 back to StackPath, StackPath pulls over port 80 again, and you get stuck in a loop.

To fix it, make sure StackPath’s Origin Pull protocol is set to HTTPS (Port 443). Then check your Hostinger .htaccess file to make sure it handles X-Forwarded-Proto properly behind a reverse proxy:

Here is the standard .htaccess block for WordPress behind a reverse proxy:

# Handle Reverse Proxy HTTPS Header

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

The 521 Origin Down Fix

A 521 error means StackPath’s edge nodes failed to open a TCP socket with Hostinger’s IP on port 443. Check these items:

  • Confirm the IP in StackPath matches the Website IP in your Hostinger hPanel.
  • Ensure your Hostinger plan is active and the domain is correctly mapped to an active document root.
  • Check Hostinger’s IP blocker to verify StackPath’s edge IP ranges were not blocked by LiteSpeed mod_security rules.

Step 6: Verify Edge Caching and Headers with cURL

Skip the browser when testing edge caching—local browser caching will mask cache misses. Use curl from your terminal to inspect the raw response headers coming off StackPath.

Run this command against a static asset or your homepage:

curl -I https://example.com/wp-content/uploads/2026/03/logo.png

Check the response headers for StackPath edge markers:

HTTP/2 200
server: NetDNA-cache/2.2
x-cache: HIT
x-hw: 1680182415.d02[52],1680182415.c[53]
content-type: image/png
cache-control: max-age=31536000, public

On your first run, x-cache might show MISS. Fire the exact same cURL command a second time. It should flip to HIT, confirming StackPath served the file directly from memory at the edge and never touched Hostinger.

For more details on controlling edge lifetimes, check the MDN HTTP Caching specification to see how Cache-Control headers shape edge behavior.

Frequently Asked Questions

Can I use Namecheap BasicDNS or do I need custom nameservers?

Namecheap BasicDNS works fine using an ALIAS or ANAME record for the root @ and a CNAME for www. You do not need to switch nameservers unless you prefer managing all DNS records directly inside StackPath.

Do I need an SSL certificate on both Hostinger and StackPath?

Yes. The Hostinger certificate encrypts traffic between StackPath and the origin server (origin pull). The EdgeSSL certificate on StackPath encrypts traffic between the visitor and the CDN edge. Running both prevents unencrypted transit across the public internet.

Why does my WordPress admin panel break behind StackPath?

StackPath should never cache /wp-admin/ or wp-login.php. In StackPath EdgeRules, create a rule that bypasses edge caching whenever the URL path matches /wp-admin/* or when standard WordPress session cookies (like wordpress_logged_in_*) are detected.

How long does it take for Namecheap DNS changes to reach StackPath?

If you drop the TTL in Namecheap to 1 minute before changing records, propagation usually wraps up in 5 to 15 minutes globally. You can track this in real time using dig +trace example.com in your terminal.

Next Steps

Once traffic flows through StackPath, keep an eye on your origin bandwidth in hPanel. You should see an immediate drop in Hostinger CPU utilization as static assets, CSS, and JS bundles get served from the CDN edge. From here, set up custom EdgeRules in StackPath to fine-tune your browser TTLs and gzip/brotli compression settings.

Official resources

all_in_one_marketing_tool