How to create subdomains
am 05.09.2007 17:04:53 von Stan SR
Hi,
I need to design and deploy an asp.net application that allows the
administrator to create separated entities (a kind of virtual copy of the
main website).
So is it possible to dynamically create subdomains using asp.net (like
entity1.mywebsite.com, entity2.mywebsite.com) ?
The sub question is do I need to declare all the subdomains within my
control panel of the company that hosts my domain name or is there a method
to bypass this action ?
Any suggestion ?
Stan
Re: How to create subdomains
am 05.09.2007 17:25:30 von Kristofer Gafvert
Question #1: Are you talking about creating DNS entries in the DNS server,
creating new websites in IIS and assign it a binding, or append a new
binding to an existing website? I suppose that everything can be done by
using ASP.NET, the question is however what methods are exposed to you to
do this, and if you have permissions to do it. You will need to ask
whoever hosts DNS or IIS to get an answer.
Question #2: We cannot answer this question without knowing how your
hosting company has set up IIS. If they are not using host headers to
distinguish between websites, you will need to add a host header. And most
likely, they use this. You will need to ask your web hosting company what
options you have.
--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
Stan SR wrote:
>Hi,
>
>I need to design and deploy an asp.net application that allows the
>administrator to create separated entities (a kind of virtual copy of the
>main website).
>So is it possible to dynamically create subdomains using asp.net (like
>entity1.mywebsite.com, entity2.mywebsite.com) ?
>The sub question is do I need to declare all the subdomains within my
>control panel of the company that hosts my domain name or is there a
>method to bypass this action ?
>
>Any suggestion ?
>
>Stan
Re: How to create subdomains
am 05.09.2007 17:52:06 von Stan SR
"Kristofer Gafvert"
> Question #1: Are you talking about creating DNS entries in the DNS server,
> creating new websites in IIS and assign it a binding, or append a new
> binding to an existing website? I suppose that everything can be done by
> using ASP.NET, the question is however what methods are exposed to you to
> do this, and if you have permissions to do it. You will need to ask
> whoever hosts DNS or IIS to get an answer.
>
First, I need to create an enty in IIS (6).
like entity.mydomainname.com (where entity is the subdomain)
For the permissions, I have all the rights (it's my own server).
So for this part, I just need to know how to create this entry using asp.net
:-)
For the DNS entries, after reading some posts on google, I see that I have
to create a subdomain like *.mydomainname.com
I m not sure if it's right, because I tried to create this entrie and it
failed.
> Question #2: We cannot answer this question without knowing how your
> hosting company has set up IIS. If they are not using host headers to
> distinguish between websites, you will need to add a host header. And most
> likely, they use this. You will need to ask your web hosting company what
> options you have.
>
>
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> Stan SR wrote:
>
>>Hi,
>>
>>I need to design and deploy an asp.net application that allows the
>>administrator to create separated entities (a kind of virtual copy of the
>>main website).
>>So is it possible to dynamically create subdomains using asp.net (like
>>entity1.mywebsite.com, entity2.mywebsite.com) ?
>>The sub question is do I need to declare all the subdomains within my
>>control panel of the company that hosts my domain name or is there a
>>method to bypass this action ?
>>
>>Any suggestion ?
>>
>>Stan
Re: How to create subdomains
am 05.09.2007 18:13:08 von Kristofer Gafvert
Hi,
#1
I assume that by entity you mean you want to create a new website with the
binding of :80:entity.mydomaniname.com.
I have an example in C# to do this, and it shouldn't be difficult to
modify it to run in an ASP.NET page. Most important is that the user
account you run the code with must have modify permissions on the metabase.
"C# - Create a new website on IIS 6.0 by code"
http://www.gafvert.info/iis/article/cs_create_website_iis6.h tm
#2
If your DNS server supports wildcards, it will resolve
whatever.mydomainname.com to the IP address you have specified. But if you
have configured IIS to bind to a specific host header, IIS may reject the
request because the host header did not match any of the configured host
headers.
So using a wildcard DNS entry also depends on how IIS is set up. I don't
know what got wrong in your attempt (error creating it or if DNS lookup
was working but IIS did not respond as you thought it would), so i cannot
give any advice about this. I need more information (if you have problems
with DNS and name resolution i would recommend you to post the question to
the DNS newsgroup).
--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
Stan SR wrote:
>
>
>"Kristofer Gafvert"
>>Question #1: Are you talking about creating DNS entries in the DNS server,
>> creating new websites in IIS and assign it a binding, or append a new binding to an existing website? I suppose that everything can be done by using ASP.NET, the question is however what methods are exposed to you to do this, and if you have permissions to do it. You will need to ask whoever hosts DNS or IIS to get an answer.
>>
>
>
>First, I need to create an enty in IIS (6).
>like entity.mydomainname.com (where entity is the subdomain)
>For the permissions, I have all the rights (it's my own server).
>So for this part, I just need to know how to create this entry using
>asp.net :-)
>
>For the DNS entries, after reading some posts on google, I see that I have
>to create a subdomain like *.mydomainname.com
>I m not sure if it's right, because I tried to create this entrie and it
>failed.
>
>
>
>>Question #2: We cannot answer this question without knowing how your
>>hosting company has set up IIS. If they are not using host headers to
>>distinguish between websites, you will need to add a host header. And most
>> likely, they use this. You will need to ask your web hosting company what options you have.
>
>
>
>
>>
>>
>>
>>-- Regards,
>>Kristofer Gafvert
>>http://www.gafvert.info/iis/ - IIS Related Info
>>
>>
>>Stan SR wrote:
>>
>>>Hi,
>>>
>>>I need to design and deploy an asp.net application that allows the
>>>administrator to create separated entities (a kind of virtual copy of the
>>>main website).
>>>So is it possible to dynamically create subdomains using asp.net (like
>>>entity1.mywebsite.com, entity2.mywebsite.com) ?
>>>The sub question is do I need to declare all the subdomains within my
>>>control panel of the company that hosts my domain name or is there a
>>>method to bypass this action ?
>>>
>>>Any suggestion ?
>>>
>>>Stan
Re: How to create subdomains
am 05.09.2007 19:05:17 von Stan SR
I thank you for your support Kristofer..
Stan
"Kristofer Gafvert" > Hi,
>
> #1
> I assume that by entity you mean you want to create a new website with the
> binding of :80:entity.mydomaniname.com.
>
> I have an example in C# to do this, and it shouldn't be difficult to
> modify it to run in an ASP.NET page. Most important is that the user
> account you run the code with must have modify permissions on the
> metabase.
>
> "C# - Create a new website on IIS 6.0 by code"
> http://www.gafvert.info/iis/article/cs_create_website_iis6.h tm
>
> #2
> If your DNS server supports wildcards, it will resolve
> whatever.mydomainname.com to the IP address you have specified. But if you
> have configured IIS to bind to a specific host header, IIS may reject the
> request because the host header did not match any of the configured host
> headers.
>
> So using a wildcard DNS entry also depends on how IIS is set up. I don't
> know what got wrong in your attempt (error creating it or if DNS lookup
> was working but IIS did not respond as you thought it would), so i cannot
> give any advice about this. I need more information (if you have problems
> with DNS and name resolution i would recommend you to post the question to
> the DNS newsgroup).
>
> --
> Regards,
> Kristofer Gafvert
> http://www.gafvert.info/iis/ - IIS Related Info
>
>
> Stan SR wrote:
>
>>
>>
>>"Kristofer Gafvert"
>>>Question #1: Are you talking about creating DNS entries in the DNS
>>>server, creating new websites in IIS and assign it a binding, or append a
>>>new binding to an existing website? I suppose that everything can be
>>>done by using ASP.NET, the question is however what methods are exposed
>>>to you to do this, and if you have permissions to do it. You will need
>>>to ask whoever hosts DNS or IIS to get an answer.
>>>
>>
>>
>>First, I need to create an enty in IIS (6).
>>like entity.mydomainname.com (where entity is the subdomain)
>>For the permissions, I have all the rights (it's my own server).
>>So for this part, I just need to know how to create this entry using
>>asp.net :-)
>>
>>For the DNS entries, after reading some posts on google, I see that I have
>>to create a subdomain like *.mydomainname.com
>>I m not sure if it's right, because I tried to create this entrie and it
>>failed.
>>
>>
>>
>>>Question #2: We cannot answer this question without knowing how your
>>>hosting company has set up IIS. If they are not using host headers to
>>>distinguish between websites, you will need to add a host header. And
>>>most likely, they use this. You will need to ask your web hosting company
>>>what options you have.
>>
>>
>>
>>
>>>
>>>
>>>
>>>-- Regards,
>>>Kristofer Gafvert
>>>http://www.gafvert.info/iis/ - IIS Related Info
>>>
>>>
>>>Stan SR wrote:
>>>
>>>>Hi,
>>>>
>>>>I need to design and deploy an asp.net application that allows the
>>>>administrator to create separated entities (a kind of virtual copy of
>>>>the main website).
>>>>So is it possible to dynamically create subdomains using asp.net (like
>>>>entity1.mywebsite.com, entity2.mywebsite.com) ?
>>>>The sub question is do I need to declare all the subdomains within my
>>>>control panel of the company that hosts my domain name or is there a
>>>>method to bypass this action ?
>>>>
>>>>Any suggestion ?
>>>>
>>>>Stan