Setup Domains redirection for a subdomain

view story

http://serverfault.com – Am not sure I this question has already been asked. Tried searching for it on serverfault, but was not able to figure it out. I am working on an app that requires to be accessible from multiple domains. More like my app supports custom domains. I have looked at apps like bitly, PHPFog able to do it and am not sure how this needs to be setup. All they give us is a subdomain like cname.bitly.com or cname.phpfog.com and once we set up the cname for the domain we are all set. Could someone point me to a resource or advice on how I could have a setup a similar infrastructure for me to be able to a (HowTos)