DNS entries, webserver, and forwarding requests

Barry Margolin barmar at alum.mit.edu
Tue Feb 24 01:39:25 UTC 2004


In article <c1e903$1gph$1 at sf1.isc.org>,
 cjwhite77 at netscape.net (Colin J. White) wrote:

> I'm not sure what the possible solutions are for the following
> problem, bear with me as I may not be using the correct terminology.
> 
> I have a website with a dns entry as www.foo.com.  The site has many
> different areas, e.g. www.foo.com/bar/ and www.foo.com/bar/ed/.  A
> portion of the site (www.foo.com/bar/ed/) has requested that all
> requests going to ed.foo.com and www.ed.foo.com (actually any
> *ed.foo.com) is redirected to www.foo.com/bar/ed/.  What are possible
> solutions to this request?  I am not to familiar with what is possible
> with dns.  Read on for clarification.
> 
> I have setup 2 virtual servers with my webserver, one to handle
> ed.foo.com and one to handle www.ed.foo.com.  For both I have set
> their docs directory to docs/bar/ed/.  Then a dns entry was added for
> both virtual servers to point to the same IP as www.foo.com.  The
> webserver handles the requests, but . . . this does not seem like a
> great solution.

That seems like the normal solution to me.  There's nothing in DNS about 
web sites and subdirectories, all it can do (in this context) is 
translate hostnames to IP addresses.  Any further work has to be done by 
the web server itself, and this is what virtual host settings are for.

> Anyone else that requests similar treatment means I
> need to setup 2 virtual servers (one for a www url request and one for
> a non-www url request) to fill the request.

I think you should ask in the WWW-related newsgroups whether there are 
any ways to simplify the virtual host settings.  Perhaps you can define 
both virtual hosts in one place, or use a wildcard of some kind (so that 
anything in the ed.foo.com domain ends up in the same virtual host).

-- 
Barry Margolin, barmar at alum.mit.edu
Arlington, MA


More information about the bind-users mailing list