I would never create a CNAME, something weird and not scalable (another thing) ...
just create a wildcard in your A record named *.yourdomain.com
the normal thing is to create a new domain just for this, for example *.yourdomainaccount.com and work with the example below, so many well-known web services use this technique.
then in your default file or in the web.config file or in any other file of your site configuration, create a simple method that receives the domain, for example Server Variable SERVER_NAME
and then redirect the user to your account.
in c #
string server = Request.ServerVariables["SERVER_NAME"]; if ( server.Contains("www.") || server.Contains("blog.") ) { // redirect the user to your main site or blog respectively } else { string user = server.Replace("http://","").split(".")[0]; Response.Redirect(String.Format("www.domain.com/users/{0}", user)); }
source share