We help IT Professionals succeed at work.

Host multiple websites with IIS7 on Windows Web Server 2008

So, I need to host multiple websites using IIS7.

The default website that comes configured works flawlessly.

I added yet another web site using "Add Web Site" under "Sites":

site name: portal
application pool: portal
physical path: C:\portaldirectory
type: http
IP address: All Unassigned
port: 80
host name: portal.mydomain.com

When I try to browse there (on the web server or from outside) I get an error:
"Internet Explorer cannot display the webpage"

No HTTP error code or anything like that.

The configuration of my default web site is as follows (which works flawlessly):

site name: default web site (doh)
application pool: DefaultAppPool
Physical path: %SystemDrive%\inetpub\wwwroot
type: http
port: 80
IP address: *

When I browse to mydomain.com, the default website loads as intended.

What could be the problem here? I didn't set anything else outside of IIS7 (merely mentioning it so you wouldn't assume that I have set other possible settings that come naturally for someone who knows what they are doing)

Thanks in advance!

Watch Question

Does portal.mydomain.com name is properly resolved by DNS?
What simple "ping portal.mydomain.com" says?


Ping request could not find the host portal.mydomain.com

(I obviously tried the real domain of course.)

So it looks like you did not add A (or CNAME) record in your DNS zone for "mydomain.com".
Where your DNS for mydomain.com is located? It's your own DNS? Or is maintained by an ISP?

Your client has to resolve name to an IP address. It's usually done by DNS. And then using this IP can send packets to your webserver. In these requests there are special field "Host header" indicating hostname you've asked for. And IIS serves proper website.
If first step fails - address remains unknown, packets are not sent and entire solution cannot work.


It's self maintained. I'm starting to get the feeling that I should not have spent half a night skimming through IIS7 configuration threads :)
So go to your DNS open zone for "mydomain.com" and add CNAME record for name "portal" as an alias of working address.
Or add A record for portal with IP address of your webserver.

The first aproach is usually better practice but both should work perfectly.


All right. I can't try it before Monday since I don't have the account info with me (doh). Will try it then. Thanks so far.

ok. Just ask when you try. Or report a success ;)
you don't assign the Host Header on every website your create.
1 more way to run your website.
just change the the ports

on browser
1st website
2nd website

and so on

if u want single port used for multiple website then you user "Host Header" option in every website.

if u want single port used for multiple website then you use "Host Header" option in every website.
Login to your domain panel and under A records add  this

*.yourdomain.com pointing to your servers ip.

Then add domain in your iis and type xyz.yourdomain.com and add that same under host header. That should do the job. Wait for few seconds for dns to Reflect changes.