Forum Moderators: phranque
You could do one of two things for the webspace: If they already have home directories, the mod_rewrite cookbook has an example to map subdomains to home directories transparently, which would save you a step. If not, you'd have to create the webspace on the fly.
There are already several DNS update scripts out there; you'll want to Google on it for your particular DNS platform. To do all of this, you'd have to be in control of your DNS servers, of course; if your provider manages them for you, it would be very difficult.
Other than that, it'd be hard to give specifics, as this is a heck of a lot of work to setup. But it can be done, for sure!