The Public Suffix List (http://publicsuffix.org/) is "a cross-vendor initiative to provide an accurate list of domain name suffixes". Such a list is necessary because "there was and remains no algorithmic method of finding the highest level at which a domain may be registered for a particular top-level domain (the policies differ with each registry)...". Public Suffix List is also a small Ruby library designed to make the Public Suffix List (http://publicsuffix.org/) easier to use.
Gemfile gem 'public-suffix-list', '~> 0.0.6'
install gem install public-suffix-list -v 0.0.6