iisserverdnsserver-administration

How does IIS identify which site is requested?


If I'm hosting multiple sites on a server, and a dns server resolves the different domainnames to the same address, (which is the server's name), how does IIS know eventually which site is requested?

So a client types the address of my 1. site -> myrandomsite.mydomain.com

Then another client types -> anotherrandomsite.mydomain.com

The DNS server resolves both of these to -> myserver.mydomain.com. So what happens then on the server?


Solution

  • The binding host header tell IIS where request to be delivered. So when you host header mutiple domain name for the same server. You have to specify your domain name in binding->host name field.

    enter image description here

    When client send a request to your IIS server, http.sys receive the request first. Then it will communicate with IIS service. IIS read applicationhost.config and tell http.sys which application pool to handle the request. Finally, the request will be delivered to the correct site and application pool.