You have a production site running on your main server, and you just need to spin up a staging environment, doc site, or client portal on Hostinger. If you blindly follow Hostinger’s onboarding prompts and swap your nameservers at Namecheap, you’ll take down your apex domain and break company email in one fell swoop.
You don’t need to touch your nameservers. By leaving authoritative DNS at Namecheap and adding a single, targeted DNS record, you can route a subdomain directly to Hostinger hPanel while your root site, MX records, and existing infrastructure keep humming along untouched.

The Core Problem With Nameserver Swapping
When you attach a domain in Hostinger, hPanel immediately pushes you to switch your nameservers to ns1.dns-parking.com and ns2.dns-parking.com. That makes sense if Hostinger hosts your entire stack. But if your root domain sits on Shopify, Vercel, or an AWS EC2 instance, swapping nameservers delegates your entire DNS zone to Hostinger.
The second that delegation hits the root servers, every existing record disappears from public view unless you manually reconstructed your entire DNS zone file in hPanel beforehand. That includes your Google Workspace or Microsoft 365 mail exchanges. If you’ve ever dealt with how to point Namecheap DNS to Hostinger without breaking email, you know how easy it is to drop mail queues by accident.
We avoid that entirely by leaving Namecheap set to Namecheap BasicDNS (or your existing external DNS provider). We’ll only touch the host records for the specific subdomain prefix.
Step 1: Retrieve Your Hostinger Server IP Address
First, grab the actual IPv4 address assigned to your Hostinger plan. Don’t assume the IP matches another site on your account—Hostinger constantly balances accounts across different server clusters and nodes.
- Log in to your Hostinger hPanel.
- Head to Websites in the main navigation.
- Find the hosting package you want to use and click Manage.
- In the left sidebar, check under Hosting → Plan Details.
- Copy the value next to Website IP address (something like
185.185.185.120).
Keep that IP on your clipboard. You’ll need it in Namecheap in a minute.
Step 2: Add the Subdomain Inside Hostinger hPanel
Hostinger’s web server (LiteSpeed) won’t serve your site just because DNS points to the box. It has to know how to route incoming HTTP requests matching your subdomain’s Host header. Skip this, and you’ll hit a default 404 or a generic Hostinger parking page.
You have two ways to set this up in hPanel:
Option A: Adding as an Addon Domain (Recommended for Isolation)
I usually add subdomains as full standalone websites. This gives the subdomain its own isolated public_html root, separate PHP version settings, independent Git deployments, and dedicated backups.
- In hPanel, go to Websites → Create or migrate a website.
- Pick your plan and select Skip, create an empty website.
- Under the domain step, pick Use an Existing Domain.
- Enter the full subdomain:
portal.example.comorapp.example.com. - Finish the wizard. Hostinger sets up a clean directory at
domains/portal.example.com/public_html.
Option B: Adding Under an Existing Domain
If your main domain example.com is already active inside your hPanel dashboard, you can just hook a subdomain directly under it:
- Go to Websites → Manage on the parent domain.
- In the sidebar, click Domains → Subdomains.
- Type your prefix into the Subdomain field (for example,
portal). - Check Custom folder for subdomain if you don’t want files cluttering your parent directory.
- Click Create.
Step 3: Configure the DNS Records in Namecheap Advanced DNS
Now hop over to Namecheap. Verify your domain is actually using Namecheap BasicDNS on the primary management screen. If your nameservers point to Cloudflare or another third party, you’ll need to create this record over there instead.
To create the record in Namecheap:
- Go to your Domain List.
- Click Manage next to your root domain.
- Open the Advanced DNS tab.
- Look for the Host Records table.
Add a new A Record. Per RFC 1035 Domain Implementation Specifications, an A record maps an IPv4 address directly to a hostname label.
- Type:
A Record - Host: Enter only your subdomain prefix. If you want
app.example.com, enterapp. Don’t enter the full domain—Namecheap appends your apex domain automatically, and typing the whole thing creates a broken record likeapp.example.com.example.com. - Value: Paste your Hostinger IP (e.g.,
185.185.185.120). - TTL: Set to
Automaticor drop it down to1 minwhile setting things up.
You can use a CNAME instead if Hostinger gives you a server hostname, but an A record avoids extra DNS roundtrips and stays cleaner if you put an edge network in front of it later. If you run into apex record limits on other setups, take a look at how we point a root domain to a CNAME in Namecheap with ALIAS.
Step 4: Verify DNS Propagation in Your Terminal
Don’t immediately open your browser to test this. Browsers love to cache failed lookups (NXDOMAIN) and sticky redirects, which makes debugging miserable.
Instead, query an external resolver like Cloudflare (1.1.1.1) or Google (8.8.8.8) using dig:
dig +short @1.1.1.1 portal.example.com AIf Namecheap pushed the record through, you’ll get your Hostinger IP right back:
185.185.185.120If it returns empty, query Namecheap’s nameservers directly to check whether the record saved on their end:
dig @dns1.registrar-servers.com portal.example.com A +noall +answerOnce Namecheap’s nameserver returns the IP, you’re golden. Any delay on your machine is just local caching, and that usually clears within 5 to 10 minutes.
Step 5: Issue a Free Let’s Encrypt SSL on Hostinger
Hostinger automates SSL through Let’s Encrypt. For this to work, Let’s Encrypt’s validation servers have to reach your Hostinger container via an HTTP-01 challenge. If you try to provision the certificate before DNS propagates, the challenge fails.
- In hPanel, navigate to the subdomain site you created.
- In the sidebar, open Security → SSL.
- Click Install SSL.
- Pick your subdomain from the list and hit Install SSL.
Hostinger drops a temporary verification token in .well-known/acme-challenge/ inside your document root. Once Let’s Encrypt hits that token and confirms ownership, the status changes to Active and sets up auto-renewal.
Need a custom certificate or a commercial wildcard instead? We covered how to install a custom Namecheap SSL certificate on Hostinger manually.
Gotcha: The Conflicting Wildcard Record Trap
I hit an annoying bug on a client rollout where the subdomain refused to load Hostinger, serving an old app instead—even though dig showed the right IP on public resolvers. The issue turned out to be an old wildcard record sitting in Namecheap’s Advanced DNS.
Take a look at your Host Records table and see if you have a catch-all record like this:
Type: A Record
Host: *
Value: 198.51.100.44
TTL: AutomaticIn theory, explicit records (like portal) should take priority over wildcards (*). In practice, if intermediate resolvers or local DNS caches have high TTL values cached for the wildcard, they can route traffic back to your old server until the cache expires completely.
If you don’t actually need that catch-all, delete the wildcard line. If you do rely on wildcards, read our guide on setting up wildcard subdomain DNS in Namecheap to make sure your records don’t collide.
What I Ran: Verifying Response Headers and LiteSpeed Status
Once DNS is answering and SSL is active, check the full HTTP exchange. I use curl with the -I flag to grab headers without pulling down the whole page payload.
curl -I https://portal.example.comA clean hit against Hostinger’s LiteSpeed stack looks like this:
HTTP/2 200 content-type: text/html; charset=UTF-8
server: LiteSpeed
platform: hostinger
x-powered-by: PHP/8.2.18
date: Wed, 12 Feb 2025 14:22:10 GMTKeep an eye on that server: LiteSpeed header. If you see nginx, cloudflare, or an Apache header from your main site’s host, your machine is still pulling the old route. Flush your local resolver with sudo resolvectl flush-caches on Linux or ipconfig /flushdns on Windows.
Securing and Isolating the Subdomain in .htaccess
Since this subdomain is completely disconnected from your main production app, don’t forget baseline security. Open up File Manager in hPanel, jump into your subdomain’s public_html, and drop these rules into your .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Block directory indexing
Options -Indexes # Protect sensitive configuration files
Require all denied
This forces HTTPS connections, disables directory browsing if you haven’t dropped an index file in yet, and keeps visitors from peeking at sensitive dotfiles like .env or .git.
Frequently Asked Questions
Will pointing a subdomain to Hostinger affect my domain email?
No. Email routing runs entirely on MX records. As long as you don’t change your nameservers away from Namecheap or touch your existing MX records, your email routes stay exactly where they are.
Can I use a CNAME record instead of an A record for my subdomain?
Yes. If Hostinger assigns you a server hostname or you’re mapping to a staging alias, you can use a CNAME Record in Namecheap. Put the subdomain prefix (like portal) in the Host field and the destination hostname in the Value field. An A record is usually simpler because it cuts out an extra DNS lookup hop.
How long does it take for the subdomain to work?
If you’re creating a brand new subdomain that didn’t exist before, it’s fast—usually between 2 and 10 minutes. If you’re repointing a subdomain that previously pointed to an old server, you’ll have to wait out the old record’s TTL before your machine routes to Hostinger.
Why does Hostinger show an SSL installation error?
Hostinger uses automated Let’s Encrypt validation over port 80. If you try installing the certificate before your Namecheap A record has finished propagating worldwide, Let’s Encrypt can’t verify the challenge. Give it 10 to 15 minutes, confirm resolution with dig +short yoursubdomain.com A, and try the install again in hPanel.
Next Steps
Your subdomain is now resolving straight to Hostinger while your main production site runs untouched on its own infrastructure. If you’re using this space for staging or internal tools, your next move should be locking down access so web crawlers and random visitors don’t stumble in. Take a look at how to password protect a WordPress staging site with .htaccess to lock down the directory with basic auth.

