Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have multiple websites hosted in a single site in IIS, and I want to recognize it with different website addresses. For example, I want http://test.mydomain.com/site/1 to be seen as www.xyz.com/site/1

where test.mydomain.com is the main site hostname.

All these sites are on intranet and same domain.

How can i do this?

share|improve this question

migrated from stackoverflow.com Sep 18 '09 at 13:13

This question came from our site for professional and enthusiast programmers.

5 Answers 5

A CNAME is a DNS record so I'd contact the admin of the DNS of your Intranet.

share|improve this answer

Alternatively, if you are merely doing this for your development/testing purposes, you will only need to edit the hosts file on your computer. You can handle the CNAME records when the time comes to make it public.

share|improve this answer

All of these answers pertain to the DNS side of things, getting the users to the server. Within IIS you still have to specify how to determine which request goes to which site. Basically, when you create a binding in IIS you have to specify port but most people don't notice there is an option for hostname as well. Assuming that you don't want to use multiple ports for the different sites, you just need to set the binding for each site including the hostname. When traffic hits the server it will check the requested hostname and return the appropriate site.

share|improve this answer
    
I did mention in my post about adding host headers to the site for each name that he wants to direct to the site. Granted, host headers is not the only way to do it and I didn't go into detail, but I did mention it. –  joeqwerty Sep 18 '09 at 14:04

The DNS side is pretty easy. A CNAME is a record that basically says "look up this other name instead and use the results of that."

So at the DNS level, you'd do something like this in the xyz.com zone:

www.xyz.com.  IN CNAME test.mydomain.com.

Specifics of how you actually do that depends on what software your DNS is running and/or how your DNS is being managed.

I believe you then have to configure IIS to accept www.xyz.com. as a valid inbound name for the site defined as test.mydomain.com.

share|improve this answer

You need to create a CNAME record or an A record (either one will work, I prefer to use A records) in your public DNS zone for each name that you want to be associated with the site. You'll also need to add host headers to the site for each name that you want to be associated with it. You'll need access to your public DNS records or request this from the party that hosts your public DNS namespace.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.