This completely depends on what your app is doing.
CakePHP is a MVC framework where you built the app you are trying to achieve. There is no “1 way” to do multi domain setup.
See e.g. Multiple domain, one core
you could also detect the domain in a custom middleware, set that attribute in the request object and do your domain specific logic dependent on that attribute.