account_location plugin, then use account_domain and use it as a key in your
access management.
Different templates, same functionality: either switch the stylesheet (CSS)
or go un-DRY by using different view folders for each domain.
The account_location plugin talks about subdomains. Do you know if
it's suitable for different top level domains?
All it does is put some convenience methods around the built-in request.domain, request.subdomains and request.port_string methods. Sometimes it’s better to go and have a look at the actual code of the plugin to see what it does (and the code of account_domain is so simple even someone who never wrote a line of ruby would understand).
account_domain will return the domain and port without the subdomain part, examples: