Multi-Homing Web Sites with IIS
Here are the steps that we've covered so far:
- Install DNS.
- Make the DNS server become its own DNS client.
- Register the domain with a domain registrant.
- Register the domain host and the DNS server.
- Create a forward standard primary lookup zone for this domain.
- Create the Host (A) record for this domain.
Now we wrap up by getting IIS to acknowledge all this stuff. IIS supports multi-homing by mapping host header names to domain names. All we have to do is create a host header name that maps to the IP address to which our DNS server resolves the domain. Open the IIS management snap-in on your web server (which may be your DNS server) by selecting Internet Information Services (IIS) Manager from the Administrative Tools menu. Expand the main node in the left pane and then expand the Web Sites folder (see Figure 5).
Figure 5 IIS management console.
Let's continue with my example. I want to create a web site called mydomain.com. To create a new domain in IIS, right-click the Web Sites folder in the left pane, select New Web Site, and follow the steps in the New Web Site Creation Wizard. The second screen of the wizard asks for a host header name. Enter the domain name (in this example, http://www.mydomain.com) in the Host Header for This Web Site field. This instruction tells IIS that any HTTP request with the domain name http://www.mydomain.com is to use the IP address assigned to the site and associate the files in the home directory specified for this domain as the files for this web site.
What if we have another web site, say http://www.mydomain2.com, or even another, http://www.mydomain3.com, tied to the same IP address? Each of these sites would have different home directories and would work fine as separate sites when accessed over the Internet. Your web server gets the domain name from the browser (via the HTTP Request header, part of the HTTP 1.1 and above protocol), and then asks DNS to resolve it to the IP address. DNS routes the request back to the web server on that IP address; IIS takes the request header information and finds the corresponding host header name. Once the host header name is found, IIS knows what home directory or files to associate with the web site.
You can add more than one host header name to a web site; for example, adding mydomain.com along with http://www.mydomain.com. This strategy ensures that users using either type of address are able to get to the site.