Re: [OT] DNS question (slightly mod_perl related...)

2000-09-05 Thread Ask Bjoern Hansen

On Thu, 31 Aug 2000, martin langhoff wrote:

...
   As you may have imagined, it maybe trivial to do in Apache (I haven't
 done it yet, but I hope it is).

I usually do it with mod_rewrite. Something like

  RewriteEngine on
  RewriteCond   %{HTTP_HOST}!^www\.ek\.dk$
  RewriteCond   %{HTTP_HOST}^(www\.)?[^.]+\.ek\.dk$
  RewriteRule   ^(.+)   %{HTTP_HOST}$1 [C]
  RewriteRule   ^(www\.)?([^.]+)\.ek\.dk(.*)/home/httpd/www.ek.dk/$2$3

should do the trick.

 What is not trivial is to trick BIND into saying it knows as
 many domains as folders I want. Or is it?

if you want only the right folders[tm], then you need to make a
little script that looks for the folders on disk (or in the database
or whatever) and exports it to a zone file.

If you just want everything, a wildcard record could do.

And you are right, neither of your (trivial ;-) ) problems has
anything to do with mod_perl.


 - ask

-- 
ask bjoern hansen - http://www.netcetera.dk/~ask/
more than 70M impressions per day, http://valueclick.com




[OT] DNS question (slightly mod_perl related...)

2000-08-31 Thread martin langhoff


the mod_perl related background:

I was recently asked if one of the domains we were hosting could have
its users folders mapped in the domain name. Something like
folder.domain.com, instead of domain.com/folder . My silly mind tumbled
around, mumbling at which apache request I was going to catch the domain
and turn it into a subrequest, and I mumbled 'yes, of course'. 

the catch:

As you may have imagined, it maybe trivial to do in Apache (I haven't
done it yet, but I hope it is). What is not trivial is to trick BIND
into saying it knows as many domains as folders I want. Or is it?

the question:

Is it possible to tell BIND to catch *.domain.com and answer the same
ip? 

the apologies:

I know. I know. I'm way off topic. Delete my msg ... I'm not a BIND
warrior, but a mod_perl developer bound to BIND woes ... 



martin



Re: [OT] DNS question (slightly mod_perl related...)

2000-08-31 Thread Matt Sergeant

On Thu, 31 Aug 2000, martin langhoff wrote:

 
 the mod_perl related background:
 
   I was recently asked if one of the domains we were hosting could have
 its users folders mapped in the domain name. Something like
 folder.domain.com, instead of domain.com/folder . My silly mind tumbled
 around, mumbling at which apache request I was going to catch the domain
 and turn it into a subrequest, and I mumbled 'yes, of course'. 
 
 the catch:
 
   As you may have imagined, it maybe trivial to do in Apache (I haven't
 done it yet, but I hope it is). What is not trivial is to trick BIND
 into saying it knows as many domains as folders I want. Or is it?
 
 the question:
 
   Is it possible to tell BIND to catch *.domain.com and answer the same
 ip? 

Yes, I believe the entry is simply *.domain.com!

Then use mod_rewrite to map the right folder.

-- 
Matt/

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org




Re: [OT] DNS question (slightly mod_perl related...)

2000-08-31 Thread David Hodgkinson


martin langhoff [EMAIL PROTECTED] writes:

   Is it possible to tell BIND to catch *.domain.com and answer the same
 ip? 

Plan A: Generate the zone files from the database.

Plan B: Use the beta of Bind 9 which, I believe, has database bindings
promised.

I've hacked around with something like plan A recently. Got to the
first 90% stage and lost interest ;-)

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



Re: [OT] DNS question (slightly mod_perl related...)

2000-08-31 Thread Jim Winstead

On Aug 31, David Hodgkinson wrote:
 martin langhoff [EMAIL PROTECTED] writes:
 
  Is it possible to tell BIND to catch *.domain.com and answer the same
  ip? 
 
 Plan A: Generate the zone files from the database.
 
 Plan B: Use the beta of Bind 9 which, I believe, has database bindings
 promised.

plan c: use a wildcard record and move on to real problems. :)

jim



Re: [OT] DNS question (slightly mod_perl related...)

2000-08-31 Thread David Hodgkinson


Jim Winstead [EMAIL PROTECTED] writes:

 On Aug 31, David Hodgkinson wrote:
  martin langhoff [EMAIL PROTECTED] writes:
  
 Is it possible to tell BIND to catch *.domain.com and answer the same
   ip? 
  
  Plan A: Generate the zone files from the database.
  
  Plan B: Use the beta of Bind 9 which, I believe, has database bindings
  promised.
 
 plan c: use a wildcard record and move on to real problems. :)

That too :-)

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



Re: [OT] DNS question (slightly mod_perl related...)

2000-08-31 Thread martin langhoff

Jim Winstead wrote:
 plan c: use a wildcard record and move on to real problems. :)

Bummer! I had thought I actually had a real problem ... 

gotta move on to find one !


martin [who can't believe this list's so great]



Re: [OT] DNS question (slightly mod_perl related...)

2000-08-31 Thread Barrie Slaymaker

Matt Sergeant wrote:
 
 Yes, I believe the entry is simply *.domain.com!
 
 Then use mod_rewrite to map the right folder.

Yup.  Beware though, there are certain issues you may need to think of if
you're going to be sending/receiving mail from these domain names.  One
problem is the reverse name lookup that mail transfer agents (sendmail,
qmail, etc).  But if all you're doing is web serving, should be Ok.

- Barrie