Avatar of induced
 asked on

PHP DNS Write for virtual webhosting

I'm writing some software that will allow people to signup for an account, and setup a domain for their account. Picture a webhosting type thing where you can signup and they will check and register the domain for you, then auto-configure the webserver for your site. Basically, keeping the user far away from apache and giving them access to a php frontend that I'm writing (template site style)

I know php very well and have a good understanding of webhosting. I'm looking for someone to point me in the right direction of what I need to do to get this going. Ie, should I be reading a book about how to configure BIND, or is there a script out there that does this sort of thing? I have root access to my server, so should this be done using shellscripts? Where would I go to find out about auto-registering domains for people? Does godaddy, networksolutions, etc have a way to register domains like this?  Basically I'm looking for either a few script links, or a book or two that will help me out with this.

For bonus points, can you reccommend a good way to bill customers? I can write the invoice part of it and all the account integration, but I'll have to run credit cards, and maybe integrate with paypal, so do you have a good idea for that?

I know this question is a little involved, but I'm going to give 500 points for it. If you have only one part of the answer, I will try to send points for a partial answer. Thanks in advance

Avatar of undefined
Last Comment

8/22/2022 - Mon
Marcus Bointon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Marcus Bointon

This could be your answer: http://bind-dlz.sourceforge.net/ It allows you to keep your DNS records in a database instead of zone files, and of course updating MySQL from PHP is a doddle.

Bind DlZ looks very much like what I'm after. I should have found that apache doc myself :)

Do you know of any good script for editing the apache config file in php?

Anyone have tips on the domain registration thing? I want the site to be all-inclusive where it will check domain availability for you and register it automatically. I suppose until I get that sorted, I could just use subdomains

Marcus Bointon

Rather than trying to edit the main config file, I'd say you should probably make use of the conf.d directory and create a file per virtual host. That way you'll limit your required syntax to only what is specific to that host, and it will make your parsing job that much easier. I'd also be tempted to not attempt to write back into the config files - just read and parse it, then regenerate it completely when you write it back. Having said that, Apache has an API for editing its config files - it's used by PHP when installing to activate mod_php. there are quite a few projects on sourceforge that may be of interest:


It strikes me that BIND-DLZ would be a perfect place to involve memcached. You'll get really  good performance and it will take lots of load off your DB. That would involve hacking the source of BIND-DLZ though.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck

Thanks for your help squinky. While it doesn't answer every question, it still helps me get going on this project and definately is going to help me out.

I'll have a look at memcached and see if it makes sense with DLZ.

Thanks again