You should be fine using the named routes, regardless of how you use them, since it will take your current domain into account. For example:
on www.domain1.com
<%= link_to "Home", root_url %> # uses 'http://www.domain1.com'
<%= link_to "Home", root_path %> # uses '/', which will go to http://www.domain1.com/
on www.domain2.com
<%= link_to "Home", root_url %> # uses 'http://www.domain2.com'
<%= link_to "Home", root_path %> # uses '/', which will go to http://www.domain2.com/