How to Create a Subdomain on Hostinger with Namecheap DNS

by Fahim

You registered your domain on Namecheap, run your DNS through Namecheap’s BasicDNS or PremiumDNS, and need a new subdomain pointing to your Hostinger web hosting account. I hit this exact workflow when standing up a dedicated API environment on api.example.com while keeping my main apex domain parked elsewhere.

Getting this running cleanly takes three distinct phases: provisioning the vhost inside Hostinger hPanel, routing the hostname using an A record in Namecheap Advanced DNS, and generating an SSL certificate once propagation clears. Doing these steps out of order usually results in failed SSL challenges or 403 Forbidden errors. Here is how to wire it up properly from scratch.

Server hardware in a rack representing Hostinger hosting infrastructure with Namecheap DNS routing
Server hardware in a rack representing Hostinger hosting infrastructure with Namecheap DNS routing

The Architecture: Splitting DNS and Web Hosting

When you use Namecheap for DNS management rather than Hostinger nameservers, Hostinger cannot automatically manipulate your zone records. Every time you create a new subdomain, staging site, or custom application folder, you must manually bridge the gap by creating an A record in Namecheap that directs traffic to your Hostinger server IP.

This decoupled setup gives you complete control over your DNS routing. You can keep your root domain email on Google Workspace or Namecheap Private Email, point your apex domain to a static site, and route your staging or web app subdomain directly to Hostinger. If you need to route traffic to completely different servers down the road, check out our guide on pointing a Namecheap subdomain to a separate server.

Step 1: Locate Your Hostinger Server IP Address

Before touching Namecheap, you need the public IPv4 address of your Hostinger hosting account. Hostinger assigns shared or dedicated IP addresses depending on your plan tier (Single, Premium, Business, or Cloud).

  1. Log in to your Hostinger hPanel dashboard.
  2. Click on Websites in the main navigation and select your primary domain or the plan hosting your new project.
  3. Look at the left-hand sidebar under Hosting Details (or navigate to Plan Details).
  4. Find the line labeled Website IP address or Server IP.

The IP address is a standard four-part numerical string, such as 185.185.185.10. Copy this value to your clipboard. You will use it directly inside your Namecheap DNS zone editor.

Step 2: Create the Subdomain in Hostinger hPanel

Hostinger needs to configure its web server (LiteSpeed or Nginx reverse proxy) to listen for requests hitting your new subdomain hostname. If you skip this step and point DNS first, your visitors will see Hostinger’s default 404 page or a generic placeholder error.

  1. Inside hPanel, navigate to Domains > Subdomains.
  2. In the Create a New Subdomain field, enter your desired prefix (for example, app, staging, or blog).
  3. Check the option for Custom folder for subdomain if you want to isolate your files from your main site root.

By default, Hostinger creates the folder at public_html/subdomain_name. If you prefer to keep your directory tree tidy, setting a custom directory like domains/app.example.com/public_html makes maintenance straightforward, especially if you plan to create a WordPress staging site on Hostinger.

Click Create. Hostinger will generate the directory structure and register the virtual host configuration in roughly 5 to 10 seconds.

Step 3: Configure the A Record in Namecheap Advanced DNS

Now that Hostinger knows how to handle incoming requests for the hostname, you must tell the internet where to send that traffic via Namecheap.

  1. Log in to your Namecheap Dashboard.
  2. Find your root domain in the Domain List and click Manage.
  3. Select the Advanced DNS tab at the top of the screen.
  4. Look at the Host Records table. If there is an existing CNAME or A record with your subdomain name, remove or edit it.
  5. Click Add New Record and configure the following parameters:
  • Type: A Record
  • Host: Enter only your subdomain prefix (e.g., app for app.example.com). Do not enter the full URL.
  • Value: Paste your Hostinger Server IP address (e.g., 185.185.185.10).
  • TTL: Set to 1 min (or Automatic). Setting a short TTL lets you verify changes quickly.

Click the green checkmark to save your record. According to the Namecheap DNS documentation, changes saved in Advanced DNS typically take 5 to 30 minutes to propagate across worldwide recursive resolvers.

Step 4: Verify DNS Propagation via Terminal

Never request an SSL certificate until you verify that DNS resolves directly to your Hostinger server IP. If you trigger an automated certificate issuance while DNS is still resolving to an old address or failing, Let’s Encrypt will fail validation and put your domain on a temporary rate limit cooldown.

I use dig in my local terminal to inspect authoritative answers directly from Namecheap’s nameservers and standard public DNS resolvers:

# Check resolution against Cloudflare public DNS
dig @1.1.1.1 app.example.com +short # Check resolution against Google public DNS
dig @8.8.8.8 app.example.com +short # Inspect the full response including TTL
dig app.example.com A

If the command returns your exact Hostinger IP address, DNS propagation is complete for that resolver. If you are on Windows without standard Unix utilities, you can run the equivalent query with nslookup:

nslookup app.example.com 8.8.8.8

Once both queries return your Hostinger IP address, you are ready to issue the SSL certificate.

Step 5: Install Free SSL on Hostinger hPanel

Hostinger includes automated Let’s Encrypt SSL certificates for all subdomains created inside hPanel. When you manage DNS externally on Namecheap, the automated SSL routine checks for the HTTP-01 challenge or valid A records pointing to the server.

  1. Return to your Hostinger hPanel dashboard.
  2. Navigate to Security > SSL.
  3. Look for your newly created subdomain in the list. If it shows Not Installed or Failed, click the three dots next to it and select Reinstall SSL or Install SSL.
  4. Select Let’s Encrypt and confirm.

Hostinger will place a temporary validation token inside .well-known/acme-challenge/ in your subdomain document root. Because our Namecheap A record is already live, Let’s Encrypt validates the domain instantly and installs the certificate.

Once installed, verify that Enforce HTTPS is toggled to ON in the same menu. If you are serving a WordPress site on this subdomain and see asset loading issues, review our tutorial on how to fix WordPress mixed content warnings and force HTTPS.

Step 6: Test HTTPS and HTTP Headers with cURL

To ensure your subdomain is resolving correctly, returning the right SSL certificate, and handling redirects properly, run a quick cURL inspection against the secure endpoint:

curl -Iv https://app.example.com

Review the output to confirm three things: the SSL handshake succeeds without issuer warnings, the server returns an HTTP/2 200 or HTTP/1.1 200 OK response, and the certificate subject matches your subdomain:

* Server certificate:
* subject: CN=app.example.com
* start date: Mar 30 00:00:00 2025 GMT
* expire date: Jun 28 23:59:59 2025 GMT
* issuer: C=US, O=Let's Encrypt, CN=R3
* SSL certificate verify ok.
> GET / HTTP/2
> Host: app.example.com
> User-Agent: curl/8.4.0
> Accept: */*
> < HTTP/2 200 < content-type: text/html; charset=UTF-8
< server: LiteSpeed

Troubleshooting Common Hostinger & Namecheap Issues

Here are the three most frequent points of failure when connecting Namecheap DNS to Hostinger subdomains, along with how to fix them.

1. The Subdomain Shows Hostinger Default Placeholder Page

If you see a generic “Domain is parked” or default landing page, Hostinger created a default default.php or index.html file inside your new document root. Connect via SFTP or hPanel File Manager, open your subdomain root directory (e.g., public_html/app), and delete the default placeholder file before uploading your project.

2. SSL Installation Stuck on “Installing” or Fails with Error

If Hostinger reports that SSL installation failed, check whether you recently added the A record. If Let’s Encrypt queried Namecheap nameservers before the record propagated, the challenge failed. Remove the failed certificate in hPanel, wait 15 minutes, clear your local DNS cache, and click Reinstall.

3. Database Connection Errors on New Installs

If you deploy a CMS or database-driven application onto your new subdomain, remember that Hostinger databases default to localhost. If you are migrating an existing database, ensure your database credentials match the database created in hPanel. If you run into connectivity issues, follow our guide to fix error establishing a database connection on Hostinger.

4. .htaccess Redirect Loops

If your subdomain serves static files or PHP but gets stuck in an infinite redirect loop when forcing HTTPS, inspect the .htaccess file in the subdomain root directory. A clean, standard HTTPS rewrite rule should look like this:


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Frequently Asked Questions

Should I use an A record or a CNAME record in Namecheap?

An A record pointing directly to Hostinger’s server IP is the most reliable method for subdomains. While a CNAME pointing to your apex domain works if the root already points to Hostinger, an A record isolates your subdomain routing so changes to your root domain do not disrupt your subdomains.

Can I run WordPress on a subdomain while my root domain uses another host?

Yes. Because you are pointing only the subdomain’s A record in Namecheap to Hostinger, your root domain remains unaffected at its current host. Inside hPanel, you can run the WordPress Auto Installer specifically targeted to the newly created subdomain folder.

How long does Namecheap DNS take to update for a subdomain?

With Namecheap BasicDNS, changes to existing records or new A records set with a 1-minute TTL typically propagate across major global resolvers in 5 to 15 minutes. In rare cases involving cached negative responses (NXDOMAIN), it can take up to an hour.

Do I need to buy an SSL certificate for my Hostinger subdomain?

No. Hostinger provides free, auto-renewing Let’s Encrypt certificates for all domains and subdomains configured in your hPanel account, provided your DNS A record points directly to the Hostinger server IP.

Next Steps

Your subdomain is now live, routed through Namecheap Advanced DNS, and secured with an active SSL certificate on Hostinger. If you plan to deploy specialized node processes or custom backend services alongside your standard web apps, check out our walkthrough on deploying Docker Compose applications on Hostinger with Namecheap DNS.

Official resources

all_in_one_marketing_tool