Wilcard DNS Forwarding. **Question**

Equinox

New member
I was just wondering:
A project I'm working on for Artashes requires that a subdomain be created for each client. This needs to be automated. I definitely dont want to give PHP access to below web-server root files (such as Zone files) so I wondered whether you could have a DNS entry that creates something like this:

*.mywebsite.com autoforwards to www.mywebsite.com/index.php?board=*

Can this be done with DNS settings or can you think of another way to do it. It needs to be done on a shared account package, so it might be more complicated than I anticipated. Any ideas?

~Equinox
 
He's using CPanel I believe, and this can be done by interfacing with CPanel , via a php script.

If you need assistance with it, just let me know.
 
Sorry, I only answered 1 of your questions, I would use a php script and sql to have it take care of the httpd.conf file, maybe even let httpd.conf be writeable by nobody or apache and have it update the httpd.conf file directly. As for the zonefiles, I would probably have a perl script that pull from the sql database, I would have it run by cron, so I could avoid having the zonefiles writeable nobody or apache. The only problem with the cron job is that the script would have a delay for creating new zones. I would probably have the cron run every hour.
 
See with free DNS services in the past I have been able to use * as a wildcard and have it forward to that * anywahere in the following URL. I dont want to give Apache or PHP access to anything below the www root and therefore cant have it automatically edit the zone files. Surely there must be a way to dynamically do it in MX and Zone files???? *grrrrr* *self-combust*
 
wildcard dns entry forwarding to apache runing a script which catches the referring url to the 404 and parses it - not straightforward but possible

the "normal" method is to do as you've been advised - update the httpd conf
 
Top