When you install Internet Information Services (IIS) on Windows Server, it creates a “Default Web Site” bound to port 80. If you try to create a second website and bind it to the same port 80 using the same IP address, IIS will throw an error and refuse to start the second site. Many novice administrators assume they must buy a separate public IP address for every website they want to host. This is incorrect. You can host hundreds of websites on a single IP address using a technology called Server Name Indication (SNI) and Host Headers.
Step 1: Understand Host Headers
When a web browser (like Chrome) requests a webpage from a server, it doesn’t just say “Give me the page.” It sends an HTTP request that includes a “Host” header. For example: Host: www.company.com.
IIS can read this header as the traffic arrives. Instead of routing traffic based solely on the IP address and port, IIS looks at the Host header and routes the traffic to the specific website configured for that domain name.
Step 2: Configure DNS
Before configuring IIS, ensure your DNS records point to your server.
- Log into your DNS registrar (e.g., GoDaddy, Cloudflare, or your internal Windows DNS server).
- Create an A Record for
www.siteA.compointing to your server’s IP address (e.g., 203.0.113.5). - Create a second A Record for
www.siteB.compointing to the exact same IP address (203.0.113.5).
Step 3: Create the First Website in IIS
- Open the Internet Information Services (IIS) Manager.
- Expand your server node, right-click on Sites, and select Add Website…
- Site name: Enter “SiteA”.
- Physical path: Browse to the folder containing Site A’s HTML files (e.g.,
C:\inetpub\wwwroot\SiteA). - Binding section:
- Type: http
- IP address: All Unassigned (or select your specific IP).
- Port: 80
- Host name: This is the magic box. Type exactly what users will type into their browser:
www.sitea.com.
- Click OK.
Step 4: Create the Second Website
Now, repeat the exact same process for the second site.
- Right-click on Sites, select Add Website…
- Site name: Enter “SiteB”.
- Physical path: Browse to
C:\inetpub\wwwroot\SiteB. - Binding section:
- Type: http
- IP address: All Unassigned (Same as before).
- Port: 80 (Same as before).
- Host name: Type
www.siteb.com.
- Click OK.
Because the “Host name” fields are different, IIS allows both websites to run simultaneously on port 80 without conflicting.
Step 5: Configuring SSL/HTTPS with SNI
Host headers work perfectly for unencrypted HTTP traffic. However, for HTTPS (port 443), the traffic is encrypted before IIS can read the Host header, meaning IIS wouldn’t know which SSL certificate to present to the browser.
To fix this, you must enable Require Server Name Indication (SNI).
- In IIS, right-click “SiteA” and select Edit Bindings…
- Click Add…
- Set the Type to
https. - Enter the Host name (
www.sitea.com). - Crucial Step: Check the box for Require Server Name Indication.
- Select Site A’s SSL certificate from the drop-down menu and click OK.
- Repeat the process for Site B, using Site B’s SSL certificate.
With SNI enabled, IIS can host multiple HTTPS websites on a single IP address, presenting the correct SSL certificate for each domain.