8

I need to serve any of my subdomains

sub1.foo.com
sub2.foo.com
anysub.foo.com

from foo.com

I have successfully added a A record with the * value in WebsitePanel.

Should i make an edit at web.config in my project to enable this feature also?

If i visit for example anysub.foo.com i get the error message

The connection to anysub.foo.com was interrupted.

which i suppose means that something is blocking the response.

How can i fix that? Should i edit the web.config somehow or what?

UPDATE

The site hosted in a shared hosting environment

OrElse
  • 9,709
  • 39
  • 140
  • 253
  • what is in your iis bindings for this website? – MoXplod Sep 02 '15 at 01:19
  • @MoXplod I do not have access to IIS settings – OrElse Sep 02 '15 at 12:41
  • That could be the problem - if IIS is only responding to one binding "foo.com" and you reach the server with "anysub.foo.com" and it has no binding to handle that or a wildcard binding on port 80 then you it wont return a response. – MoXplod Sep 02 '15 at 20:18
  • Possible duplicate of http://stackoverflow.com/questions/458757/wildcard-subdomains-in-iis7-is-it-possible-to-make-them-like-it-is-in-apache – Thomas Weller Sep 07 '15 at 19:08
  • Possible cross site duplicate http://serverfault.com/questions/84921/how-to-configure-iis-wildcards-for-account-subdomains-like-basecamp – Thomas Weller Sep 07 '15 at 19:08
  • The error you mention is an IIS error or an ASP.NET error? I am guessing IIS error and in that case you should ask your hosting provider for that. – Tasos K. Sep 08 '15 at 06:40

2 Answers2

2

Unfortunately, it is not possible to bind wildcard hosts with IIS on a shared hosting environment. You need to have a dedicated machine with a dedicated IP that handles all incoming traffic, without being bound to a specific domain (i.e. default IIS website handling all incoming traffic).

AFAIK, this feature is not supported in IIS even in version 8.5.

On the DNS side, make sure it's set as a CNAME * pointing to @.

Community
  • 1
  • 1
santamanno
  • 626
  • 4
  • 12
  • Can you please post an example of wildcard binding configuration in IIS 6? AFAIK it's not possible. Wildcard SSL certificate is another matter but you have to define each host independently. What Chocol8 needs is a "catch-all" host that handles all traffic to *.domain.com – santamanno Sep 08 '15 at 09:34
  • Crap, you are right. The server where I configured this in the past simply uses ARR and rewrites requests to internal server aliases. What you _can_ do though is have a catch-all (no domain name configured) and connect it to an IP address. But that is covered in [other posts already](http://stackoverflow.com/questions/458757/wildcard-subdomains-in-iis7-is-it-possible-to-make-them-like-it-is-in-apache). I've removed my comment to avoid confusion. – Abel Sep 08 '15 at 09:52
1

If your website is hosted at WebsitePanel you probably need to use the "Add Web Site Pointer" to make the A record know which Website to use.

(You might also need to remove the previously created A record.)

Tubbe
  • 1,068
  • 6
  • 22
  • And next to that, it'll depend on whether the shared hosting company the OP is using allows this. Typically they ask extra money for added domains, whether subdomain or not. But some also offer unlimited subdomains as an option. – Abel Sep 08 '15 at 09:30
  • Yes, that's probably true. [Though](http://www.websitepanel.net/global-forums/topic/issues-with-adding-websites-domain-alias/page/2/#post-4395) – Tubbe Sep 08 '15 at 09:35