Map.root by domain?

Is it possible to set map.root by domain?

If domain is: “domain1.com” then map.root :controller => “domain1”
Else if domain is: “domain2.com” then map.root :controller => “domain2”