IIS - Need to create sub domain in IIS 6.0 - Asked By Jem Savery on 25-Jan-12 10:30 AM

Hi Friends,

I have DNS. I have a website in my IIS like "mydomain.com"

Now I need to create subdomains like "subdomain1.mydomain.com", "subdomain2.mydomain.com" 

How can I do this in DNS? Do I need to register these subdomain names as we do for main domain?

Please help me asap.

Thanks.
D Company replied to Jem Savery on 25-Jan-12 10:52 AM
Hello Friend,

Sub-domain configuration starts with an entry in the DNS server of the parent domain and the lookup resolves the sub-domain to an IP address of the web server. The web server in turn delegates the requests based on its configuration for the sub-domain. Various sub-domain configurations can be used effectively to distribute the load evenly among available web applications or web servers listening to different IP addresses. The load distribution is achieved by the DNS round robin feature of the BIND. Other uses include application isolation, simpler and professional looking URL, content categorization etc.

here are the steps to create sub domain.

Configuring the web server for sub-domains
Once the DNS server is setup to send the request for the sub-domain to the corresponding IP address, the work of the web server begins. The web server needs to be configured appropriately to handle the request for the sub-domain based on either the IP address or the host header entry. Host headers are commonly used by web servers to host multiple domains or sub-domains on one IP address.

Microsoft Windows IIS :

In case of Internet Information Server (IIS), create a new web site for the subdomain using the IIS Manager, and add the sub-domain (e.g. subdomain.domain.com) as a new host header value listening to the same IP address as specified in the DNS entry. The port is set to 80 (the default for http requests). The host header can be added by clicking on the advanced tab next to the IP address configuration for that web site application. If the subdomain points to a subdirectory of the web site for the domain, then set the home directory for the subdomain web site to the subdirectory. For example, if the domain.com points to C:\Inetpub\wwwroot\ and the subdomain needs to be setup for C:\Inetpub\wwwroot\subdomain, then the directory for the subdomain website should be set to C:\Inetpub\wwwroot\subdomain.


Hope this will hep you!!
Regards
D
Riley K replied to Jem Savery on 25-Jan-12 11:05 AM


 Make sure your DNS is setup to point to your subdomain.

 You must add an additional website in IIS 7 named subdomain.site.com

Sites > Add Website
Site Name: subdomain.site.com
Physical Path: select the subdomain directory
Binding: same ip as site.com
Host name: subdomain.site.com

Regards
Jem Savery replied to D Company on 25-Jan-12 11:05 AM
Can you please provide steps to do it in IIS 6.0?
Jem Savery replied to Riley K on 25-Jan-12 11:30 AM
I have II 6.0 installed.

I have created the site. But didn't get the point about provinding same IP address.

Please can you explain more about it.

I have created a separate site for my subdomain. But it is not working..

Thanks.
D Company replied to Jem Savery on 25-Jan-12 11:42 AM
hello Jem,

follow this article,

http://stackoverflow.com/questions/4333380/how-to-create-subdomain-in-iis6


hope this will help you!!
regards
D
smr replied to Jem Savery on 25-Jan-12 11:49 AM
hi

Assuming you are working with a live server that you REMOTE DESKTOP INTO and not a shared hosting account here is what you will need to do:

Let's assume your file system looks like this:

c:\inetpub\wwwroot\www.foo.es { some html files in here}

c:\inetpub\wwwroot\www.foo.es\bar {some html files in here}

Without any custom ISAPI filters installed, you would do this by setting up two WEBSITE's in IIS.

The first website would have a home directory of c:\inetpub\wwwroot\www.foo.es and the 2 host headers "www.foo.es" and "foo.es"

The second website would have a home directory of c:\inetpub\wwwroot\www.foo.es\bar and 1 host header "bar.foo.es"

Once you DNS has a CNAME of "bar" that points to your server and you clear your local dns caches, this should work. If you don't know how to make the DNS change the easiest thing you can do is log into to your domain name control panel from whoever you purchased the domain name with and do the following:

ADD A CNAME RECORD: For the host enter "bar" for the points to enter "foo.es" and you should be all set