One Windows VPS, Many Sites: IIS Host Header Bindings

Run several websites on one Windows VPS and one IP address. Give each IIS site its own app pool and host-header bindings, and use SNI so each HTTPS site serves its own certificate.

dns WindowsVPS Team calendar_today schedule5 min read
One Windows VPS, Many Sites: IIS Host Header Bindings
tocOn this page 8 sections
  1. How IIS picks a site for each request
  2. Prepare the VPS
  3. Create one folder and one app pool per site
  4. Create the sites with host header bindings
  5. Add HTTPS with SNI
  6. Test before and after DNS
  7. Keep the server healthy as sites grow
  8. FAQ

IIS can serve many websites from one Windows VPS and one public IP address. Each site gets a binding that pairs the IP and port with a host name such as shop.example.com. IIS reads the Host header of each request and sends it to the matching site. For HTTPS you turn on Server Name Indication (SNI) on each 443 binding, so every site can present its own certificate on the same IP.

How IIS picks a site for each request

A binding has four parts: protocol, IP address, port and host name. IIS stores it as IP:port:hostname, for example *:80:shop.example.com. When a request arrives, HTTP.sys looks for an exact host name match first. If none matches, it falls back to a binding with an empty host name. If there is no fallback either, the visitor gets HTTP 400 Bad Request – Invalid Hostname. Every site can therefore use port 80 and port 443, as long as each binding has a different host name.

Prepare the VPS

Connect over RDP and open PowerShell as Administrator. If IIS is not installed yet, install it with the management tools:

Install-WindowsFeature Web-Server -IncludeManagementTools

Then make sure inbound ports 80 and 443 are open in Windows Firewall. Installing IIS usually adds the "World Wide Web Services" rules. If those rules are missing or disabled, add an explicit rule:

New-NetFirewallRule -DisplayName "Web 80-443" -Direction Inbound -Protocol TCP -LocalPort 80,443 -Action Allow

At your DNS provider, create an A record for every host name (both example.com and www.example.com, for example). Point each one at the VPS's public IP.

Create one folder and one app pool per site

A separate application pool runs each site in its own w3wp.exe worker process under its own identity. If one site crashes or leaks memory, the others keep running, and you can recycle one site without touching the rest.

Import-Module WebAdministration

$sites = "shop.example.com", "blog.example.org"
foreach ($s in $sites) {
    $path = "C:\inetpub\sites\$s"
    New-Item -ItemType Directory -Path $path -Force | Out-Null
    New-WebAppPool -Name $s
    icacls $path /grant "IIS AppPool\${s}:(OI)(CI)RX"
}

The icacls line gives the pool's virtual account read and execute rights on that site's folder only. If an application needs to write somewhere, such as an uploads folder, grant Modify on that subfolder only, not on the whole site root.

Create the sites with host header bindings

New-Website -Name "shop.example.com" -PhysicalPath "C:\inetpub\sites\shop.example.com" `
    -ApplicationPool "shop.example.com" -IPAddress "*" -Port 80 -HostHeader "shop.example.com"

New-Website -Name "blog.example.org" -PhysicalPath "C:\inetpub\sites\blog.example.org" `
    -ApplicationPool "blog.example.org" -IPAddress "*" -Port 80 -HostHeader "blog.example.org"

# Extra host names for the same site
New-WebBinding -Name "blog.example.org" -Protocol http -Port 80 -HostHeader "www.blog.example.org"

In the GUI, the same steps are in IIS Manager > Sites > Add Website. To add more host names later, select the site and open Actions > Bindings > Add, then fill in the Host name field.

Decide what to do with Default Web Site

Default Web Site has the binding *:80: with no host name, so it catches every request that matches no other site, including requests made to the bare IP. You can keep it as a blank catch-all page or stop it:

Stop-Website -Name "Default Web Site"

When it is stopped, requests for unknown host names get the 400 error instead of a default page. That is the cleaner result for a production server.

Add HTTPS with SNI

Without SNI, IIS can bind only one certificate to each IP:port pair. That means one HTTPS site per IP. With SNI, the browser sends the host name during the TLS handshake, and IIS picks the matching certificate. The IISAdministration module, which ships with Windows Server 2016 and later, can create the binding and attach the certificate in one command:

Import-Module IISAdministration
$cert = Get-ChildItem Cert:\LocalMachine\My | Where-Object Subject -like "*shop.example.com*"

New-IISSiteBinding -Name "shop.example.com" -BindingInformation "*:443:shop.example.com" `
    -Protocol https -CertificateThumbPrint $cert.Thumbprint `
    -CertStoreLocation "Cert:\LocalMachine\My" -SslFlag Sni

In IIS Manager, the same setting is the Require Server Name Indication checkbox in the https binding dialog. Repeat the command for each host name. If you don't have certificates yet, our guide to getting free HTTPS for an IIS site with win-acme shows how to issue them and renew them automatically. win-acme can create SNI bindings for every site it finds.

Test before and after DNS

On the VPS, send a request with a chosen Host header to check routing without touching DNS:

curl.exe -I -H "Host: shop.example.com" http://127.0.0.1/
Get-IISSiteBinding -Name "shop.example.com"
Get-Website | Select-Object Name, State, ApplicationPool

From your own PC, you can also add a temporary line such as 203.0.113.10 shop.example.com to C:\Windows\System32\drivers\etc\hosts and browse the site normally. Remove the line once real DNS is live. If a site returns the wrong content, the most common cause is a typo in the binding's host name. The next most common is a leftover binding with an empty host name on another site.

Keep the server healthy as sites grow

  • Set a recycling schedule and memory limit per pool under Application Pools > Advanced Settings > Recycling, so one heavy site doesn't starve the rest.
  • Log each site to its own folder (Site > Logging) so you can trace problems per domain.
  • Watch RAM and CPU per w3wp.exe in Task Manager's Details tab. Add the Command line column to see which pool each process belongs to.
  • Lock the server down before going public. Our Windows Server VPS hardening checklist covers RDP exposure, updates and firewall rules.

For plan sizing and ASP.NET notes, see our Windows VPS for IIS and ASP.NET hosting page.

FAQ

Do I need a separate IP address for each website?

No. Host header bindings on HTTP and SNI bindings on HTTPS let all sites share one IP. You need extra IPs only for very old clients that don't support SNI, or for software that requires a dedicated IP.

How many sites can one Windows VPS run?

IIS has no small fixed limit. The practical limit is RAM and CPU, because each active app pool runs its own worker process. Static sites use very little. Busy ASP.NET or PHP sites need more memory per pool.

Why does every domain show the same site?

One site probably has a binding with an empty host name that catches all traffic, while the other sites' bindings are missing or misspelled. Run Get-WebBinding and check each host name field.

Run this on your own Windows VPS

Get a Windows VPS from WindowsVPS in about 60 seconds, with full Administrator access over RDP, NVMe storage and the Windows license included.

Buy a Windows VPS →

dns

Written by the WindowsVPS Team

We run Windows Server VPS hosting and write these guides from the same setups our customers use: RDP, PowerShell, trading terminals and always-on bots. Questions about a guide? Contact us.

About WindowsVPS Windows VPS guides All articles

Ready to deploy your server?

Windows or Linux VPS — up and running in under 60 seconds.