« Previous Next »

Not Answered Thread: Enabling wildcard subdomains in shared ip plans

Last post 11-13-2009 1:05 PM by tomkmvp. 19 replies.

Average Rating Rate It (5)

RSS

Page 1 of 2 (20 items) 1 2 Next >

Sort Posts:

  • 03-28-2007, 6:07 PM

    • m_olia
    • Not Ranked
    • Joined on 09-21-2005, 6:10 AM
    • Posts 3

    Enabling wildcard subdomains in shared ip plans

    Hi there,

    i am using a shared ip for my website, and i want to map *.domain.com to domain.com, and then, in application layer, decide which subdomain was requested. i've googled some, but the overall result i got, is that it's only applicable for dedicated ips. is n't there really, any way to handle this? are all weblogs using dedicated ip s?!

    thanks in advance for any help
     

  • 03-28-2007, 11:12 PM In reply to

    Re: Enabling wildcard subdomains in shared ip plans

    Pretty much, every site you see on the internet of any size is a dedicated IP.  But wildcard mapping really isn't even an IIS issue, it's a DNS issue.  Once the wildcard DNS is configured, every host at domain.com is directed to the IP that serves your site.  I'm assuming you're using host headers for a shared IP since you don't mention ports, and a wildcard host header is not possible.  But you might be able to use this technique:

    http://msmvps.com/blogs/bernard/archive/2005/03/22/39218.aspx

    As an alternative, use a URL remapper and point the host.domain.com request to www.domain.com/host instead.  ISAPIRewrite is a good product to do this with.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 03-28-2007, 11:17 PM In reply to

    Re: Enabling wildcard subdomains in shared ip plans

    AFAIK, this is only possible by tweaking the dns host record '*' and point it to a particular IP. and the website just bind to the IP without any host header.

    Say *.abc.com -> 1.1.1.1
          *.xyz.com -> 1.1.1.1

    At the incoming default page, you then determine which url to redirect the client request.

    Cheers,
    Bernard Cheah
  • 03-29-2007, 8:07 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,254
    • IIS MVPs

    Re: Enabling wildcard subdomains in shared ip plans

    The problem is though because he's on a shared server, IIS will not know what site to send the requests to because there are other domains on that IP and no host header sites defined in his IIS.

    If this were just for one domain it would be ok.

  • 03-29-2007, 1:31 PM In reply to

    Re: Enabling wildcard subdomains in shared ip plans

    He would have to use the same technique for all domains.  But re-reading the post he may not have control over the other domains, I assumed he controlled the box and only had a single IP address.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 03-29-2007, 3:39 PM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,254
    • IIS MVPs

    Re: Enabling wildcard subdomains in shared ip plans

  • 03-29-2007, 9:38 PM In reply to

    Re: Enabling wildcard subdomains in shared ip plans

    LOL.... I don't have picture :)  oh wait. let me put one.
    Cheers,
    Bernard Cheah
  • 03-31-2007, 12:35 PM In reply to

    Re: Enabling wildcard subdomains in shared ip plans

    The wildcard DNS record is only one aspect as you mentioned.  The would need a default port 80 setting enabled not shared with anyone else in IIS.  We use ISAPI-Rewrite at ORCS Web and provides a nice way to have unlimited domains pointed at a dedicated IP.  Sharing a single IP, they must be using host-headers.  It would be nice to have the ability to use *.domain.com in IIS. 

    btw: I like the picture, Bernards is a bit boring. :-)

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 04-01-2007, 12:29 AM In reply to

    Re: Enabling wildcard subdomains in shared ip plans

    Mmm. but the trick here is with DNS where it support * as host record. For IIS not sure if this is in RFC, been a while never read those 'boring' doc :)  isapi would be a better way to control like rather than checking the incoming url at default page.

    Zz... i have uploaded my avatar but it is not working !!!!



    Edit - Opps !  The fish is here :)

    Cheers,
    Bernard Cheah
  • 04-01-2007, 8:27 AM In reply to

    Re: Enabling wildcard subdomains in shared ip plans

    MS DNS supports a wildcard, I'm assuming *nix DNS supports it too.  IIS, I don't believe you can put *.example.com as a host-header.  It sure would be nice to do that, but I doubt the HTTP 1.1 or 1.0 spec allows it.

    btw: Nice avatar!

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 11-03-2009, 8:12 AM In reply to

    • omen666
    • Not Ranked
    • Joined on 11-03-2009, 1:04 PM
    • Posts 4

    Re: Enabling wildcard subdomains in shared ip plans

    HI,

    Hope you dont mind me tagging onto the bottom of this but im not quite getting my head around this and have a similar requirement...

    I have a dedicated server with several domains all on different websites within IIS.  For one of the domains I want to be able to handle wildcard domains:

    http://*.domain.com

    eg. damian.domain.com

    I want to maintain the full URL as passed to IIS but be able to handle this with a website within IIS and then bebale to pick up the details of the subdomain from the request header and do something with it in code. 

    I have been looking at the donain rewrite modue etc and reading several posts but not sure what is the qrite thing to use.

    As i have several live sites on this server I am scared to just go hacking about with this as i might screw something up and take the other sites down.

    Can you give me any help with this?

    Thanks

    Damian

     

  • 11-03-2009, 10:42 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,254
    • IIS MVPs

    Re: Enabling wildcard subdomains in shared ip plans

    omen666:
    I have a dedicated server with several domains all on different websites within IIS.

    Does each domain/web site have its own IP address?

    Without that, I don't think what you want is possible because with one shared IP, each site must have a host header defined and IIS does not support a wildcard host header.

  • 11-03-2009, 11:10 AM In reply to

    • omen666
    • Not Ranked
    • Joined on 11-03-2009, 1:04 PM
    • Posts 4

    Re: Enabling wildcard subdomains in shared ip plans

    Hi Tom - thanks for the comments

    I have seen it done from the browser side of things on an iis server (unless they entered thousands of host entries which i doubt).  It was done to personalise domains.

    Readng the posts in this threads it is all very similar so was hoping for a workaround.

    I just went to look for maybe a third party component to handle this and my search phrase fetched my question up as the number one google item!  lol - someones trying to tell me something! :)

    Hoping someone involved with the url re-writing might be able to shed some light on it.

     

  • 11-04-2009, 2:26 AM In reply to

    Re: Enabling wildcard subdomains in shared ip plans

    This needs to be done at header portion, when it hits url rewrite, it already choosen the site :).
    Not sure when IIS going to support this, but for now, you can create * A record and point to the IP address, then get the website bind to the IP without host header.

    If you want to performance addtional magic, then you can use url rewrite or app level to control/redirect based on the host name in the url.

    Cheers,
    Bernard Cheah
  • 11-04-2009, 10:35 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,254
    • IIS MVPs

    Re: Enabling wildcard subdomains in shared ip plans

    omen666:
    Hoping someone involved with the url re-writing might be able to shed some light on it.

    It's not about url re-writing, it's how IIS handles host headers. 

    If this was the only site on the server then it would work perfectly.  You would just NOT define any host headers and IIS would answer any request.

    Your problem is you have other sites on other domains at this same IP.  That forces you to define an explicit host header for each site.

Page 1 of 2 (20 items) 1 2 Next >
Microsoft Communities