I think an even more reliable means would be to define a user route. In this regular route, you retrieve the domain and put it in the route values.
Then you can have a base controller (as described by Josh) that defines a domain property or the like, and stores that value for convenience (or just retrieves it on demand, anyway).
Pulling it up the route values so you can use this information anywhere in the application along the request path, and not just in the controller, so you will get more reuse from it this way. You can, for example, use it in a custom authorization filter to process user rights in this domain, etc.
source share