WELCOME >>
Home services products support
Thursday, February 09, 2012 ..:: Blogs » Brian Swanson ::.. Register  Login
Oct 3

Written by: Brian Swanson
10/3/2008 4:34 PM 

I'm working on a new "secret" project web site with a friend of mine.  One of the features we want to implement on the site is the ability to enter a sub-domain as a search/filter of sorts for the site.  There are two different elements that come in to play when implementing a feature like though (well three when you count the programming on the site itself):  DNS, and IIS.

It turns out that both are actually trivial...

To implement a wildcard sub-domain using Microsoft DNS it is as simple as adding an A record for your given domain where the hostname is '*' (no quotes).

To implement a wildcard sub-domain using Microsoft IIS requires a dedicated IP address for the site.  Open IIS Manager, find your website, right-click and then click on Properties.  on the "Web Site" tab of the properties window that opens up, click the "Advanced" button.  Typically there should only be a single entry, so you might need to edit it.  Make sure an IP address for the server is selected (instead of "All Unassigned"), and that there is no "Host header value" defined.

 

And for those programming in VB.NET, if you'd like to know what the user entered as their URL once they reach your site, you can use Request.Url.Host to determine the requested hostname, which you'll then have to parse off the first part to get your search term.

 

Tags:

1 comment(s) so far...

Re: Wildcard sub-domain for Microsoft IIS and DNS

Hi Brian, how would you test this in localhost? Thanks for the great post.

By darwin on   2/8/2009 1:40 PM

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 









Copyright 2008 by Purple Ant LLC   Terms Of Use  Privacy Statement