A couple of hours after your post I sent you a "private message" via this forum. (Since you're new, you need to login to the forum and click on "Check Private" at the top.)
Bottom line, I have a script that I wrote for another Dreamhost customer that does what you need to do. But it isn't freeware.
I put the details and contact information in the "private message".